Hi,
I want to run asyncio event loop in its own thread, and schedule tasks
from the main thread (or a different thread). The problem is that
asyncio.async() is not "thread-safe": it doesn't wake-up the event
loop thread.
A workaround is to use: loop.call_soon_threadsafe(asyncio.async, ...,
loop=loop).
Is it a bug or is the workaround the right solution?
For your information, my question is for an event loop for the Olso
Messaging project, a component of OpenStack. See my work-in-progress
patchset:
https://review.openstack.org/#/c/70948
I also plan to use greenio to reuse greenlet event loop, so tasks
executed by asyncio will run in the main thread. But at least for my
tests, I would like to use a separated asyncio event loop running in a
dedicated thread.
Victor