[Python-ideas] Enabling Event.set to notify all waiters with an exception
Mark E. Haase
mehaase at gmail.com
Wed Jul 19 14:28:28 EDT 2017
On Wed, Jul 19, 2017 at 2:37 AM, Pau Freixes <pfreixes at gmail.com> wrote:
> Not at all, the idea is taking into advantage the Event principle,
> having a set of Futures waiting to be awakened and returning either a
> value or exception.
That's not the principle of Event. You are describing a Future.
Regarding the propagation of the cancellation if and only if *all*
> callers are canceled IMHO will fall on the side of a complex problem,
> and the solution might be do nothing.
If you're willing to do nothing when all callers cancel, then the Future
solution that Nathaniel posted should work for you (replacing
ensure_future() with shield()).
Have you tried it? Do you have a specific objection to it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170719/a5d601ea/attachment.html>
More information about the Python-ideas
mailing list