private function assertNotQueueManagerIsLocked()
 {
     $this->assertFalse($this->lock->isLocked());
 }
 public function test_process_ShouldNotDirectlyProcessQueue_IfAlreadyLocked()
 {
     Queue\Factory::getSettings()->numQueueWorkers->setValue(1);
     $this->handler->enableProcessingInTrackerMode();
     $this->queue->setNumberOfRequestsToProcessAtSameTime(1);
     // there is only one worker, so make sure that queue is locked
     $lock = new Queue\Lock($this->backend);
     $lock->acquireLock(0);
     $this->assertSame(0, $this->queue->getNumberOfRequestSetsInAllQueues());
     $this->processDummyRequests();
     $this->assertSame(1, $this->queue->getNumberOfRequestSetsInAllQueues());
     $this->processDummyRequests();
     $this->assertSame(2, $this->queue->getNumberOfRequestSetsInAllQueues());
     $this->queue->unlock();
 }
 private function acquireAllQueueLocks()
 {
     for ($queueId = 0; $queueId < $this->queue->getNumberOfAvailableQueues(); $queueId++) {
         $this->lock->acquireLock($queueId);
     }
 }
Ejemplo n.º 4
0
 public function expireLock($ttlInSeconds)
 {
     return $this->lock->expireLock($ttlInSeconds);
 }
Ejemplo n.º 5
0
 private function assertNumberOfLocksEquals($numExpectedLocks)
 {
     $this->assertSame($numExpectedLocks, $this->lock->getNumberOfAcquiredLocks());
 }