Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

> Use Task.cancel() or use a Queue to communicate with the task.

One reason why Task.cancel() is an incomplete replacement for 
Task.set_exception() is that you don't have an easy way to communicate why the 
task was ended.

With set_exception() and set_result(), you could. Task.cancel(), though, 
doesn't let you e.g. specify a CancelledError subclass or "reason" string (see 
the related bpo-35674, "Add argument to .cancel() of Task and Future").

----------
nosy: +chris.jerdonek

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32363>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to