[issue24383] consider implementing __await__ on concurrent.futures.Future

Guido van Rossum report at bugs.python.org
Thu Jun 4 17:43:48 CEST 2015


Guido van Rossum added the comment:

So in issue24017 I wrote:

"""
Maybe it's possible to give an interpretation to awaiting on a threaded
Future? __await__ could return a new asyncio Future, and add a completion
callback to the original Future that makes the asyncio Future ready and
transfers the result/exception. This would have to use
loop.call_soon_threadsafe() to transfer control from the exector thread to
the thread where the loop is running.

The only thing I don't know is whether it's possible for __await__ to
return a Future.
"""

Yuri, is that possible?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24383>
_______________________________________


More information about the Python-bugs-list mailing list