def _process_worker(call_queue, result_queue):
 while True:
  call_item = call_queue.get(block=True)
  if (call_item is None):
   result_queue.put(os.getpid())
   return
  try:
   r = call_item.fn(*call_item.args, **call_item.kwargs)
  except BaseException as e:
   result_queue.put(_ResultItem(call_item.work_id, exception=e))
  else:
   result_queue.put(_ResultItem(call_item.work_id, result=r))

def _process_worker ( call_queue , result_queue ) : while True : call_item = call_queue . get ( block = True ) if ( call_item is None ) : result_queue . put ( os . getpid ( ) ) return try : r = call_item . fn ( * call_item . args , ** call_item . kwargs ) except BaseException as e : result_queue . put ( _ResultItem ( call_item . work_id , exception = e ) ) else : result_queue . put ( _ResultItem ( call_item . work_id , result = r ) )
evaluates calls from call_queue and places the results in result_queue .