Example #1
0
    def setUp(self):
        # Some items to play with.
        self.item_a = FakeQueueItem("a")
        self.item_b = FakeQueueItem("b")
        self.item_c = FakeQueueItem("c")
        self.item_d = FakeQueueItem("d")
        self.item_e = FakeQueueItem("e")

        # And an empty priority queue.
        self.queue = PriorityQueue()
Example #2
0
    def __init__(self, batch_executions=False):
        """Create an executor.

        batch_executions (bool): if True, the executor will receive a
            list of operations in the queue instead of one operation
            at a time.

        """
        super(Executor, self).__init__()

        self._batch_executions = batch_executions
        self._operation_queue = PriorityQueue()
Example #3
0
 def tearDown(self):
     self.queue = PriorityQueue()