3 ms·
I've wrestled with this. A cleaner solution seems to be: using an asyncio.Queue. So when your function is not reentrant, params = await command.get() runs in a
by nurettin 6y ago
I've wrestled with this. A cleaner solution seems to be: using an asyncio.Queue.
So when your function is not reentrant, params = await command.get() runs in a loop inside a task ( command.put_nowait(params) is called elsewhere)
you can also use this to distribute tasks to different class methods
- cheez 6y agoI will keep this in mind!