Я видел, как люди расширяли класс очереди.Queue, чтобы сделать что-то вроде:
Код: Выделить всё
class async_queue(Queue):
async def aput(self, item):
self.put_nowait(item)
async def aget(self):
resp = await asyncio.get_event_loop().run_in_executor( None, self.get )
return resp
Подробнее здесь: https://stackoverflow.com/questions/596 ... -in-python