Question about asyncio doc example

Marko Rauhamaa marko at pacujo.net
Thu Jul 24 13:07:10 EDT 2014


Ian Kelly <ian.g.kelly at gmail.com>:

> 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.


Marko



More information about the Python-list mailing list