コード例 #1
0
 def _make_runtime(self, flow, initial_state=None):
     compilation = compiler.PatternCompiler(flow).compile()
     flow_detail = pu.create_flow_detail(flow)
     store = storage.SingleThreadedStorage(flow_detail)
     # This ensures the tasks exist in storage...
     for task in compilation.execution_graph:
         store.ensure_atom(task)
     if initial_state:
         store.set_flow_state(initial_state)
     task_notifier = misc.Notifier()
     task_executor = executor.SerialTaskExecutor()
     task_executor.start()
     self.addCleanup(task_executor.stop)
     return runtime.Runtime(compilation, store,
                            task_notifier, task_executor)
コード例 #2
0
 def _make_runtime(self, flow, initial_state=None):
     compilation = compiler.PatternCompiler(flow).compile()
     flow_detail = pu.create_flow_detail(flow)
     store = storage.Storage(flow_detail)
     nodes_iter = compilation.execution_graph.nodes_iter(data=True)
     for node, node_attrs in nodes_iter:
         if node_attrs['kind'] in ('task', 'retry'):
             store.ensure_atom(node)
     if initial_state:
         store.set_flow_state(initial_state)
     atom_notifier = notifier.Notifier()
     task_executor = executor.SerialTaskExecutor()
     retry_executor = executor.SerialRetryExecutor()
     task_executor.start()
     self.addCleanup(task_executor.stop)
     r = runtime.Runtime(compilation, store, atom_notifier, task_executor,
                         retry_executor)
     r.compile()
     return r
コード例 #3
0
ファイル: engine.py プロジェクト: pombredanne/taskflow-1
 def __init__(self, flow, flow_detail, backend, options):
     super(SerialActionEngine, self).__init__(flow, flow_detail, backend,
                                              options)
     self._task_executor = executor.SerialTaskExecutor()
コード例 #4
0
ファイル: endpoint.py プロジェクト: ygkim93/OpenStackInAction
 def __init__(self, task_cls):
     self._task_cls = task_cls
     self._task_cls_name = reflection.get_class_name(task_cls)
     self._executor = executor.SerialTaskExecutor()