That's what yield from is for.

On Friday, April 4, 2014, Paul Tagliamonte <[email protected]> wrote:

> Heyya folks,
>
> I seem to be having trouble having short lived coroutines run whilst a
> longer-running coroutine is running.
>
> Basically, in the long-running coroutine, I want to dispatch a few
> shorter functions out - but I want them all running at once.
>
> So, what I did was to call `loop.run_until_complete` inside the
> long-running coroutine, but when the short-lived routine dies, it rasies
> an RuntimeError (Event loop stopped before Future completed)
>
> I'm sure this is user error; anyone have docs on how to dispatch small
> coroutines during the runtime of a long-lived one?
>
>
> Cheers,
>   Paul
>
> --
> #define sizeof(x) rand()
> </paul>
> :wq
>


-- 
--Guido van Rossum (on iPad)

Reply via email to