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 10:23:29 +0300 Organization: A noiseless patient Spider Lines: 17 Message-ID: <87d2cvmd8u.fsf@elektro.pacujo.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="15718"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182ApwPQqvKrov3a3l1hnv7" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:UQkmPqmYvgmkfb/ubVAQ97YE6iM= sha1:Oa7a7W4VDoCOyl9aSmt0NIH0db0= Xref: csiph.com comp.lang.python:75131 Terry Reedy : > 18.5.3. Tasks and coroutines, seems to be devoid of event wait > examples. However, there is a 'yield from' network example in 18.5.5 > Streams using socket functions wrapped with coroutines. These should > definitely be used instead of sleep. In fact, for cross-platform > network code meant to run on *nix and Windows, they are better than > the unix oriented select and poll functions. Asyncio has full support for the callback style as well. What I don't know is how well the two styles mix. Say, you have a module that produces callbacks and another one that is based on coroutines. The coroutines can easily emit callbacks but can callbacks call "yield from"? Marko