This repository has been archived by the owner on Nov 23, 2017. It is now read-only.
Question: what's the morale behind having a asyncio.Future
?
#490
Labels
asyncio.Future
?
#490
It seems that
asyncio.Future
is quite different fromconcurrent.futures.Future
, for example, in terms of how cancellation works:asyncio.Future.cancel()
Cancel the future and schedule callbacks. If the future is already done or cancelled, return False. Otherwise, change the future’s state to cancelled, schedule the callbacks and return True.
concurrent.futures.Future.cancel()
Attempt to cancel the call. If the call is currently being executed and cannot be cancelled then the method will return False, otherwise the call will be cancelled and the method will return True.
A concurrent future is "future" in the sense that it's return time is arbitrary, which is not the case for async tasks, whose return time is deterministic relative to the code with access to the task object.
The text was updated successfully, but these errors were encountered: