Add priority queues to handle seqno

This commit is contained in:
Stuckinaboot
2019-04-02 22:05:14 -04:00
committed by zixuanzh
parent 0190481e10
commit f6299c7dee
2 changed files with 22 additions and 6 deletions

View File

@ -0,0 +1,14 @@
import asyncio
class ReadOnlyQueue():
def __init__(self, queue):
self.queue = queue
async def get(self):
"""
Get the next item from queue, which has items in the format (priority, data)
:return: next item from the queue
"""
return (await self.queue.get())[1]