py-libp2p/libp2p/pubsub/read_only_queue.py
2019-04-03 15:13:56 -04:00

15 lines
323 B
Python

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]