def _manager_worker_process(output_queue, futures, is_shutdown):
 log.info('starting up manager worker: %s', threading.current_thread())
 while (not is_shutdown.is_set()):
  try:
   workitem = output_queue.get()
   future = futures.get(workitem.work_id, None)
   log.debug('dequeue manager response: %s', workitem)
   if (not future):
    continue
   if workitem.is_exception:
    future.set_exception(workitem.response)
   else:
    future.set_result(workitem.response)
   log.debug('updated future result: %s', future)
   del futures[workitem.work_id]
  except Exception as ex:
   log.exception('error in manager')
 log.info('manager worker shutting down: %s', threading.current_thread())

def _manager_worker_process ( output_queue , futures , is_shutdown ) : log . info ( 'starting up manager worker: %s' , threading . current_thread ( ) ) while ( not is_shutdown . is_set ( ) ) : try : workitem = output_queue . get ( ) future = futures . get ( workitem . work_id , None ) log . debug ( 'dequeue manager response: %s' , workitem ) if ( not future ) : continue if workitem . is_exception : future . set_exception ( workitem . response ) else : future . set_result ( workitem . response ) log . debug ( 'updated future result: %s' , future ) del futures [ workitem . work_id ] except Exception as ex : log . exception ( 'error in manager' ) log . info ( 'manager worker shutting down: %s' , threading . current_thread ( ) )
this worker process manages taking output responses and tying them back to the future keyed on the initial transaction id .