reserveFromTube() public method

Reserves/locks a ready job from the specified tube.
public reserveFromTube ( string $tube, integer $timeout = null ) : boolean | Phalcon\Queue\Beanstalk\Job
$tube string
$timeout integer
return boolean | Phalcon\Queue\Beanstalk\Job
Beispiel #1
0
 public function testShouldPutAndReserve()
 {
     $this->client->putInTube(self::TUBE_NAME, 'testPutInTube');
     $job = $this->client->reserveFromTube(self::TUBE_NAME);
     $this->assertNotEmpty($job);
     $this->assertInstanceOf(self::JOB_CLASS, $job);
     $this->assertTrue($job->delete());
 }
Beispiel #2
0
 public function testPutAndReserve()
 {
     $this->client->putInTube($this->tubeName, 'testPutInTube');
     $job = $this->client->reserveFromTube($this->tubeName);
     $this->assertNotEmpty($job);
     $this->assertInstanceOf('Phalcon\\Queue\\Beanstalk\\Job', $job);
     $this->assertTrue($job->delete());
 }