예제 #1
0
function getBeanstalk()
{
    $beanstalk = new Pheanstalk\Pheanstalk(configParam('beanstalk_host'));
    if (configParam('beanstalk_tube') == 'default') {
        $beanstalk->watch(configParam('beanstalk_tube'));
    } else {
        $beanstalk->watch(configParam('beanstalk_tube'))->ignore('default');
    }
    return $beanstalk;
}
예제 #2
0
 function index()
 {
     $beanstalk = new \Pheanstalk\Pheanstalk('127.0.0.1');
     $beanstalk->useTube("testtube");
     /*for($i=1;$i<=100;$i++) {
           $id = $beanstalk->putInTube("testtube","job payload goes heres\n".$i);
           echo $id.PHP_EOL;
       }*/
     $job = $beanstalk->watch("testtube")->ignore('default')->reserve();
     echo $job->getData();
     //$beanstalk->delete($job);
 }