def _queue_manangement_worker(executor_reference, processes, pending_work_items, work_ids_queue, call_queue, result_queue, shutdown_process_event):
 while True:
  _add_call_item_to_queue(pending_work_items, work_ids_queue, call_queue)
  try:
   result_item = result_queue.get(block=True, timeout=0.1)
  except queue.Empty:
   executor = executor_reference()
   if (_shutdown or (executor is None) or executor._shutdown_thread):
    if (not pending_work_items):
     shutdown_process_event.set()
     for p in processes:
      p.join()
     return
   del executor
  else:
   work_item = pending_work_items[result_item.work_id]
   del pending_work_items[result_item.work_id]
   if result_item.exception:
    work_item.future.set_exception(result_item.exception)
   else:
    work_item.future.set_result(result_item.result)

def _queue_manangement_worker ( executor_reference , processes , pending_work_items , work_ids_queue , call_queue , result_queue , shutdown_process_event ) : while True : _add_call_item_to_queue ( pending_work_items , work_ids_queue , call_queue ) try : result_item = result_queue . get ( block = True , timeout = 0.1 ) except queue . Empty : executor = executor_reference ( ) if ( _shutdown or ( executor is None ) or executor . _shutdown_thread ) : if ( not pending_work_items ) : shutdown_process_event . set ( ) for p in processes : p . join ( ) return del executor else : work_item = pending_work_items [ result_item . work_id ] del pending_work_items [ result_item . work_id ] if result_item . exception : work_item . future . set_exception ( result_item . exception ) else : work_item . future . set_result ( result_item . result )
manages the communication between this process and the worker processes .