def deterministicReactorThreads():
 (worker, doer) = createMemoryWorker()
 class CFT(object, ):
  def callFromThread(self, f, *a, **k):
   worker.do((lambda : f(*a, **k)))
 return (CFT(), doer)

def deterministicReactorThreads ( ) : ( worker , doer ) = createMemoryWorker ( ) class CFT ( object , ) : def callFromThread ( self , f , * a , ** k ) : worker . do ( ( lambda : f ( * a , ** k ) ) ) return ( CFT ( ) , doer )
create a deterministic l{ireactorthreads} @return: a 2-tuple consisting of an l{ireactorthreads}-like object and a 0-argument callable that will perform one unit of work invoked via that objects c{callfromthread} method .