def _make_engine(self, flow, flow_detail=None): return eng.SingleThreadedActionEngine(flow, flow_detail=flow_detail)
def revert(self, joe_number, *args, **kwargs): print("Calling %s and apologizing." % joe_number) class CallSuzzie(task.Task): def execute(self, suzzie_number, *args, **kwargs): raise IOError("Suzzie not home right now.") def revert(self, suzzie_number, *args, **kwargs): # TODO(imelnikov): this method should not be requred pass flow = lf.Flow('simple-linear').add( CallJim(), CallJoe(), CallSuzzie() ) engine = eng.SingleThreadedActionEngine(flow) engine.storage.inject({ "joe_number": 444, "jim_number": 555, "suzzie_number": 666 }) try: engine.run() except Exception as e: print "Flow failed: %r" % e
def _make_engine(flow): e = eng.SingleThreadedActionEngine(flow) e.compile() return e
def _make_engine(flow): e = eng.SingleThreadedActionEngine(flow) e.compile() e.storage.inject([('context', {})]) return e