示例#1
0
 public function pop($n = 1, $timeout = 0)
 {
     $n = count($this->safeQueue->pop($n, $timeout));
     if ($n) {
         return $this->mainQueue->pop($n, 0);
     }
     return [];
 }
示例#2
0
 public function test_unShift_and_pop()
 {
     $input = [1, 2, 3];
     $this->queue->unShift($input);
     $output = $this->queue->pop(3);
     $this->assertEquals(array_reverse($input), $output);
 }