This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bwhmather
Recipients bwhmather
Date 2014-10-25.20:41:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1414269700.02.0.917285833698.issue22729@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-10-25 20:41:40bwhmathersetrecipients: + bwhmather
2014-10-25 20:41:40bwhmathersetmessageid: <1414269700.02.0.917285833698.issue22729@psf.upfronthosting.co.za>
2014-10-25 20:41:39bwhmatherlinkissue22729 messages
2014-10-25 20:41:39bwhmathercreate