Message230016
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 waiters and callbacks are triggered at different points after a cancel (waiters in `set_condition_and_notify_cancel` and callbacks in `cancel`.) This is a problem as it means that implementing `wait` and `as_completed` using `add_done_callback` will result in a behaviour change unless the behaviour of `add_done_callback` is changed instead.
I don't believe the current behaviour is as documented anyway so I'm not sure if this is a problem. See issue 22630.
I am a little uncertain about the O(n) implementation of `remove_done_callback` but can't imagine a situation where it would be a problem. |
|
Date |
User |
Action |
Args |
2014-10-25 20:41:40 | bwhmather | set | recipients:
+ bwhmather |
2014-10-25 20:41:40 | bwhmather | set | messageid: <1414269700.02.0.917285833698.issue22729@psf.upfronthosting.co.za> |
2014-10-25 20:41:39 | bwhmather | link | issue22729 messages |
2014-10-25 20:41:39 | bwhmather | create | |
|