[Python-ideas] Chaining asyncio futures?

Vincent Michel vxgmichel at gmail.com
Thu Jun 30 08:12:54 EDT 2016


 >> Wouldn't this be a nice feature in asyncio.Future?

It does exist actually, as `asyncio.futures._chain_future`:
https://github.com/python/asyncio/blob/master/asyncio/futures.py#L411

It is used in `loop.run_in_executor` and `run_coroutine_threadsafe` to 
connect asyncio futures and concurrent futures together.

 > As best as I can work out, the only reason that asyncio Future?s 
don?t behave this way is that asyncio strongly emphasises the use of 
coroutines to program in this manner.

I agree, I think that's why this function is not exposed.

/Vincent


More information about the Python-ideas mailing list