Exemplo n.º 1
0
 def compile(self):
     if self._compiled:
         return
     self._compilation = self._compiler.compile()
     self._runtime = runtime.Runtime(self._compilation, self.storage,
                                     self.atom_notifier,
                                     self._task_executor)
     self._compiled = True
Exemplo n.º 2
0
 def compile(self):
     if self._compiled:
         return
     self._compilation = self._check_compilation(self._compiler.compile())
     self._runtime = runtime.Runtime(self._compilation,
                                     self.storage,
                                     self.atom_notifier,
                                     self._task_executor,
                                     self._retry_executor,
                                     options=self._options)
     self._runtime.compile()
     self._compiled = True
Exemplo n.º 3
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)
Exemplo n.º 4
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