Message295116
I think this is a good solution as it let the user define easily the behavior it needs in other situation too. I would recommend adding the object responsible for the failure to the _on_queue_thread_error callback. This would simplify the error handling.
@@ -260,8 +260,16 @@ class Queue(object):
info('error in queue thread: %s', e)
return
else:
- import traceback
- traceback.print_exc()
+ self._on_queue_thread_error(e, obj)
+
+ def _on_queue_thread_error(self, e, obj):
+ """
+ Private API called when feeding data in the background thread
+ raises an exception. For overriding by concurrent.futures.
+ """
+ import traceback
+ traceback.print_exc()
+ |
|
Date |
User |
Action |
Args |
2017-06-04 08:59:35 | tomMoral | set | recipients:
+ tomMoral, pitrou, davin, xiang.zhang, grzgrzgrz3 |
2017-06-04 08:59:34 | tomMoral | set | messageid: <1496566774.99.0.337618634577.issue30414@psf.upfronthosting.co.za> |
2017-06-04 08:59:34 | tomMoral | link | issue30414 messages |
2017-06-04 08:59:34 | tomMoral | create | |
|