Beanstalkd初体验

​安装beanstalkd

#首先使EPEL生效(参考:http://fedoraproject.org/wiki/EPEL/FAQ#howtouse):
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#安装beanstalkd
yum install beanstalkd

推荐使用加载类文件方式调用
可到http://sourceforge.net/projects/beanstalk/ 下载php客户端代码(见附件)
PHP使用范例:

 array( '127.0.0.1:11300' ),
        'select'        => 'random peek'
    ));  
    $beanstalk->use_tube('foo');
    $beanstalk->put(0, 0, 120, 'say hello world');         
    $beanstalk->watch('foo');
    $job = $beanstalk->reserve_with_timeout();
    echo $job->get();                  // Output: 'say hello world'   
    Beanstalk::delete($job);                    // Delete the job.
?>