示例#1
0
 /**
  * @return array
  */
 protected function getStats()
 {
     if (!$this->stats) {
         $this->stats = $this->beanstalk->stats();
     }
     return $this->stats;
 }
示例#2
0
 public function testMarkAsErrorBuriesBeanstalkJob()
 {
     $jobId = 123;
     $job = $this->getMock('\\Phlib\\JobQueue\\JobInterface');
     $job->expects($this->any())->method('getId')->will($this->returnValue($jobId));
     $this->beanstalk->expects($this->once())->method('bury')->with($this->equalTo($jobId));
     $this->jobQueue->markAsError($job);
 }
示例#3
0
文件: Pool.php 项目: phlib/beanstalk
 /**
  * @param ConnectionInterface $connection
  * @param integer $id
  * @return string
  */
 public function combineId(ConnectionInterface $connection, $id)
 {
     if (!is_numeric($id)) {
         throw new InvalidArgumentException('Specified job id must be a number.');
     }
     return "{$connection->getName()}.{$id}";
 }
示例#4
0
 /**
  * @inheritdoc
  */
 public function markAsError(JobInterface $job)
 {
     return $this->beanstalk->bury($job->getId());
 }