def parallel_execute_iter(objects, func, get_deps):
 if (get_deps is None):
  get_deps = _no_deps
 results = Queue()
 state = State(objects)
 while True:
  feed_queue(objects, func, get_deps, results, state)
  try:
   event = results.get(timeout=0.1)
  except Empty:
   continue
  except thread.error:
   raise ShutdownException()
  if (event is STOP):
   break
  (obj, _, exception) = event
  if (exception is None):
   log.debug(u'Finished processing: {}'.format(obj))
   state.finished.add(obj)
  else:
   log.debug(u'Failed: {}'.format(obj))
   state.failed.add(obj)
  (yield event)

def parallel_execute_iter ( objects , func , get_deps ) : if ( get_deps is None ) : get_deps = _no_deps results = Queue ( ) state = State ( objects ) while True : feed_queue ( objects , func , get_deps , results , state ) try : event = results . get ( timeout = 0.1 ) except Empty : continue except thread . error : raise ShutdownException ( ) if ( event is STOP ) : break ( obj , _ , exception ) = event if ( exception is None ) : log . debug ( u'Finished processing: {}' . format ( obj ) ) state . finished . add ( obj ) else : log . debug ( u'Failed: {}' . format ( obj ) ) state . failed . add ( obj ) ( yield event )
runs func on objects in parallel while ensuring that func is ran on object only after it is ran on all its dependencies .