Exemple #1
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()
Exemple #2
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()
Exemple #3
0
    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
Exemple #4
0
 def __init__(self, bus, event_name="deferred_work"):
     AsynchronousExecutePlugin.__init__(self, bus, 1, event_name)
     self.timers = {}
     self.current_timer_id = 0