Question about asyncio doc example

Marko Rauhamaa marko at
Thu Jul 24 19:07:10 CEST 2014

Ian Kelly <ian.g.kelly at>:

> Callbacks can easily schedule coroutines, but they can't wait on them,
> because that would require suspending their execution, dropping back
> to the event loop, and resuming later -- in other words, the callback
> would need to be a coroutine also.

I guess the key is, can a callback release a lock or semaphore, notify a
condition variable, or put an item into a queue that a coroutine is
waiting on?

Quite possibly. Didn't try it. In that case, callbacks mix just fine
with coroutines.


More information about the Python-list mailing list