[New-bugs-announce] [issue34430] Double chaining futures in asyncio.future.wrap_future

Alfred Sawaya report at bugs.python.org
Sat Aug 18 07:02:20 EDT 2018


New submission from Alfred Sawaya <alfred at huji.fr>:

asyncio.future.wrap_future is used to wrap a concurrent.future.Future in a asyncio.future.Future. 

The actual implementation as the following behaviours : 

 1) When the concurrent.future.Future gets a result, the asyncio.future.Future gets the same result,
 2) When the asyncio.future.Future is cancelled, the concurrent.future.Future is cancelled

I wonder why the futures synchronisation is not symmetrical ?
I propose to add the following behaviours : 

 3) When the asyncio.future.Future gets a result, the concurrent.future.Future gets the same result,
 4) When the concurrent.future.Future is cancelled, the asyncio.future.Future is cancelled

I have also posted a request pull that implements the proposed behaviours, in case of acceptation.

If there is good reasons to not implement the proposed behaviours, I would be glad to know.

Thank you !

----------
components: asyncio
messages: 323703
nosy: asvetlov, huji, yselivanov
priority: normal
pull_requests: 8280
severity: normal
status: open
title: Double chaining futures in asyncio.future.wrap_future
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34430>
_______________________________________


More information about the New-bugs-announce mailing list