asyncio - run coroutine in the background

Paul Rubin no.email at nospam.invalid
Wed Feb 17 23:38:14 EST 2016


Marko Rauhamaa <marko at pacujo.net> writes:
> @asyncio.coroutine
> def background_task(): ...
>     while time.time() - t < 10:
>         pass

Wait, that's a cpu-busy loop, you can't do that in cooperative
multitasking.  Of course you need a wait there.



More information about the Python-list mailing list