[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-14 Thread Ben Mather
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

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-14 Thread Ben Mather
Changes by Ben Mather bwhmat...@bwhmather.com: Added file: http://bugs.python.org/file36909/change-docs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22630

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-14 Thread Ben Mather
Changes by Ben Mather bwhmat...@bwhmather.com: Added file: http://bugs.python.org/file36910/change-docs-and-waiters.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22630

[issue22729] `wait` and `as_completed` depend on private api

2014-10-25 Thread Ben Mather
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

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-25 Thread Ben Mather
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

[issue22729] `wait` and `as_completed` depend on private api

2015-09-21 Thread Ben Mather
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

[issue22729] concurrent.futures `wait` and `as_completed` depend on private api

2017-10-03 Thread Ben Mather
Ben Mather <bwhmat...@bwhmather.com> 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

[issue22729] concurrent.futures `wait` and `as_completed` depend on private api

2017-10-03 Thread Ben Mather
Ben Mather <bwhmat...@bwhmather.com> 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 ignor