示例#1
0
 def _make_engine(self, flow, flow_detail=None, executor=None):
     if flow_detail is None:
         flow_detail = p_utils.create_flow_detail(flow, self.book,
                                                  self.backend)
     return eng.MultiThreadedActionEngine(flow, backend=self.backend,
                                          flow_detail=flow_detail,
                                          executor=executor)
示例#2
0
文件: engine.py 项目: kebray/taskflow
 def __init__(self, flow, flow_detail=None, book=None, backend=None):
     if flow_detail is None:
         flow_detail = p_utils.create_flow_detail(flow,
                                                  book=book,
                                                  backend=backend)
     ActionEngine.__init__(self, flow,
                           storage=t_storage.Storage(flow_detail, backend))
示例#3
0
文件: engine.py 项目: kebray/taskflow
 def __init__(self, flow, flow_detail=None, book=None, backend=None,
              executor=None):
     if flow_detail is None:
         flow_detail = p_utils.create_flow_detail(flow,
                                                  book=book,
                                                  backend=backend)
     ActionEngine.__init__(self, flow,
                           storage=t_storage.ThreadSafeStorage(flow_detail,
                                                               backend))
     if executor is not None:
         self._executor = executor
         self._owns_executor = False
         self._thread_count = -1
     else:
         self._executor = None
         self._owns_executor = True
         # TODO(harlowja): allow this to be configurable??
         try:
             self._thread_count = multiprocessing.cpu_count() + 1
         except NotImplementedError:
             # NOTE(harlowja): apparently may raise so in this case we will
             # just setup two threads since its hard to know what else we
             # should do in this situation.
             self._thread_count = 2
示例#4
0
 def _make_engine(self, flow, flow_detail=None):
     if flow_detail is None:
         flow_detail = p_utils.create_flow_detail(flow, self.book,
                                                  self.backend)
     return eng.SingleThreadedActionEngine(flow, backend=self.backend,
                                           flow_detail=flow_detail)