def __init__(self): # We periodically emit newly gathered output from tool invocations. self._emitter_thread = \ PeriodicThread(target=self.flush, name='output-emitter', period_secs=0.5) self._emitter_thread.daemon = True # Map from workunit id to workunit. self._workunits = {} # We report to these reporters. self._reporters = {} # name -> Reporter instance. # We synchronize on this, to support parallel execution. self._lock = threading.Lock()