コード例 #1
0
ファイル: task_executor.py プロジェクト: ZubairNabi/ciel
 def __init__(self, bus, worker, master_proxy, execution_features, num_threads=1):
     AsynchronousExecutePlugin.__init__(self, bus, num_threads, "execute_task")
     self.worker = worker
     self.block_store = worker.block_store
     self.master_proxy = master_proxy
     self.execution_features = execution_features
     self.current_task_set = None
     self._lock = Lock()
コード例 #2
0
ファイル: deferred_work.py プロジェクト: sos22/ciel
 def stop(self):
     """
     Shut the plugin down.  Items which have been queued for
     deferred execution will be abandoned, as will any which have
     been queued to the worker thread but not yet started.  Waits
     until any items which have been started complete.  There's no
     built-in way to tell which items are completed and which are
     abandoned, but it's not particularly difficult to do something
     from the work items.
     """
     for timer in self.timers.values():
         timer.cancel()
     AsynchronousExecutePlugin.stop(self)
コード例 #3
0
 def __init__(self,
              bus,
              worker,
              master_proxy,
              execution_features,
              num_threads=1):
     AsynchronousExecutePlugin.__init__(self, bus, num_threads,
                                        "execute_task")
     self.worker = worker
     self.block_store = worker.block_store
     self.master_proxy = master_proxy
     self.execution_features = execution_features
     self.current_task_set = None
     self._lock = Lock()
コード例 #4
0
ファイル: deferred_work.py プロジェクト: sos22/ciel
    def __init__(self, bus):
        """
        DeferredWorkPlugin(bus)

        Create a new deferred work worker thread and attach it to the
        bus @bus.  Work items can be enqueued using either
        do_deferred() (which runs them immediately) or
        do_deferred_after() (which runs them after a timeout).  The
        work items should be simple callables with no arguments.

        Note that there is only one worker thread, so slow items will
        prevent any other items from running.
        """
        AsynchronousExecutePlugin.__init__(self, bus, 1)
        self.timers = {}
        self.current_timer_id = 0
コード例 #5
0
ファイル: deferred_work.py プロジェクト: BeverlyAb/ciel_2.7
 def stop(self):
     for timer in self.timers.values():
         timer.cancel()
     AsynchronousExecutePlugin.stop(self)
コード例 #6
0
ファイル: deferred_work.py プロジェクト: BeverlyAb/ciel_2.7
 def __init__(self, bus, event_name="deferred_work"):
     AsynchronousExecutePlugin.__init__(self, bus, 1, event_name)
     self.timers = {}
     self.current_timer_id = 0