Ben Mather added the comment:
@Nathaniel
RE `remove_done_callback`: This was added as an optimisation to allow the
`as_completed` iterator to remove callbacks for future that it has visited
instead of having to store a separate set of visited futures and ignore them
when their callbacks are
Ben Mather added the comment:
The patch is indeed a little outdated, but I would be happy to pick it and get
it working again.
First we need a resolution to #22630 though.
Currently calling `cancel` will invoke callbacks, but waiters won't be
triggered until `set_running_or_notify_cance
Ben Mather added the comment:
Sorry for slow response. I completely missed your reply.
I was working on a project that used a concurrent.futures thread pool but also
needed to listen to responses from a chip-and-pin card reader.
Payment sessions operated in three phases:
- check with card
Ben Mather added the comment:
Have uploaded patch to re-implement `wait` and `as_completed` using callbacks.
See issue 22729. Sorry for sitting on it for so long.
--
Added file: http://bugs.python.org/file37017/non-magic-waiters.patch
___
Python
New submission from Ben Mather:
Adds `remove_done_callback` to `Future` object, removes `_waiters` attribute,
and re-implements `wait` and `as_completed` using callbacks.
This makes it possible to extend or replace `Future` without having to mimic
its private `_waiters` interface.
Currently
Changes by Ben Mather :
Added file: http://bugs.python.org/file36910/change-docs-and-waiters.patch
___
Python tracker
<http://bugs.python.org/issue22630>
___
___
Pytho
Changes by Ben Mather :
Added file: http://bugs.python.org/file36909/change-docs.patch
___
Python tracker
<http://bugs.python.org/issue22630>
___
___
Python-bugs-list m
New submission from Ben Mather:
The documentation for the `set_running_or_notify_cancel` method on
`concurrent.futures.Future` states that it will notify waiting threads and
trigger callbacks after the `Future` has been cancelled, however currently this
is done immediately by the call to