Use a single sender

Instead of register many different senders (one for each needed
proxy notification type) just use a single sender for all the
different types to save space and time when the senders are
pickled across to the worker(s).

Change-Id: I1e1ab6c708c855e5868061bc338d399a38ad954e
This commit is contained in:
Joshua Harlow
2015-01-12 18:13:59 -08:00
parent 81b3e3470b
commit 4c756ef852

View File

@@ -487,8 +487,10 @@ class ParallelProcessTaskExecutor(ParallelTaskExecutor):
needed.add(event_type)
if progress_callback is not None:
needed.add(_UPDATE_PROGRESS)
for event_type in needed:
clone.notifier.register(event_type, _EventSender(channel))
if needed:
sender = _EventSender(channel)
for event_type in needed:
clone.notifier.register(event_type, sender)
def _submit_task(self, func, task, *args, **kwargs):
"""Submit a function to run the given task (with given args/kwargs).