我已尝试在两个不同的服务器上运行beanstalkd并进行一些测试(在本地MacOSX上从源代码编译,并在安装了yum的CentOS服务器上)
我可以让服务器运行
sudo beanstalkd -d -p 11300
Run Code Online (Sandbox Code Playgroud)
要么
sudo beanstalkd -p 11300 &
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用php lib,它就冻结了.直接连接:
telnet localhost 11300
Run Code Online (Sandbox Code Playgroud)
我执行以下操作来模仿PHP测试脚本:
use foo
USING foo
put 0 0 120 5
hello
INSERTED 1
reserve-with-timeout 0
TIMED_OUT
Run Code Online (Sandbox Code Playgroud)
如果我跑
reserve
Run Code Online (Sandbox Code Playgroud)
它被无限期地卡住了.
PHP代码是
/**
* BeanStalk 0.10 - Example code
*
* This is a quick example to get you started using the client.
*/
require(dirname(__FILE__).'/../src/BeanStalk.class.php');
/**
* Connect to the beanstalkd server(s)
*
* Option array:
*
* array(
* 'servers' => array( 'ip:port'[, …Run Code Online (Sandbox Code Playgroud) beanstalkd ×1