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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user