Exemplo n.º 1
0
 /**
  * Updates a job. 
  * 
  * @param ymcJobQueueJob $job 
  */
 public function update(ymcJobQueueJob $job)
 {
     if ($job instanceof Serializable) {
         $state = $job->serialize();
     } else {
         $state = '';
     }
     $this->storage->update($job->id, get_class($job), $state, $job->executeAt, $job->priority);
 }
 public function testPushAndPop()
 {
     $queue = new QueueStorage();
     $queue->push(1);
     $queue->push(2);
     $queue->push(3);
     $this->assertEquals(1, $queue->pop());
     $this->assertEquals(2, $queue->pop());
     $this->assertEquals(3, $queue->pop());
 }