Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Question about asyncio doc example Date: Thu, 24 Jul 2014 20:07:10 +0300 Organization: A noiseless patient Spider Lines: 16 Message-ID: <87mwbysn29.fsf@elektro.pacujo.net> References: <87d2cvmd8u.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="29447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19N9eZzLwJuQXFpFxh/oNU9" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:LkWhbJ+wMhOdSfEOG/8ERlraaOo= sha1:DVr1uSMJRvtQJU6EaLg7+YjLdhw= Xref: csiph.com comp.lang.python:75154 Ian Kelly : > 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