我已经安装了Pheanstalk bundle for Laravel (https://github.com/mikelbring/Pheanstalk),现在我正在按照基本的示例代码尝试将作业传递到队列并再次检索它。
这是我的代码:
Route::get('queue', function()
{
Pheanstalk::useTube('testtube')->put("job payload goes here\n");
$pheanstalk = Pheanstalk::connection();
$job = $pheanstalk
->watch('testtube')
->ignore('default')
->reserve();
echo $job->getData();
$pheanstalk->delete($job);
});然而,当我运行它时,我得到了一个“未处理的响应”错误,好像什么都没有返回。
Unhandled Exception
Message:
Unhandled response:
Location:
C:\wamp\www\adam\phire\bundles\pheanstalk\pheanstalk\classes\Pheanstalk\Command\PutCommand.php on line 108
Stack Trace:
#0 C:\wamp\www\adam\phire\bundles\pheanstalk\pheanstalk\classes\Pheanstalk\Connection.php(121): Pheanstalk_Command_PutCommand->parseResponse('', NULL)
#1 C:\wamp\www\adam\phire\bundles\pheanstalk\pheanstalk\classes\Pheanstalk.php(511): Pheanstalk_Connection->dispatchCommand(Object(Pheanstalk_Command_PutCommand))
#2 C:\wamp\www\adam\phire\bundles\pheanstalk\pheanstalk\classes\Pheanstalk.php(273): Pheanstalk\Pheanstalk->_dispatch(Object(Pheanstalk_Command_PutCommand))
#3 C:\wamp\www\adam\phire\application\routes.php(45): Pheanstalk\Pheanstalk->put('job payload goe...')
#4 [internal function]: Laravel\Bundle::{closure}()
#5 C:\wamp\www\adam\phire\laravel\routing\route.php(163): call_user_func_array(Object(Closure), Array)
#6 C:\wamp\www\adam\phire\laravel\routing\route.php(124): Laravel\Routing\Route->response()
#7 C:\wamp\www\adam\phire\laravel\laravel.php(167): Laravel\Routing\Route->call()
#8 C:\wamp\www\adam\phire\public\index.php(34): require('C:\wamp\www\ada...')
#9 {main}有人熟悉Pheanstalk并能提供一些帮助吗?
谢谢亚当。
发布于 2013-04-26 18:22:45
Here就是引发这种异常的地方。看起来你的beanstalkd返回了pheanstalk不理解的东西。你确定你正在连接一个工作的beanstalkd实现吗?
这似乎不是Pheanstalk Laravel捆绑包的问题。您是否尝试过使用相同的连接细节使用常规的Pheanstalk进行测试?
https://stackoverflow.com/questions/16150200
复制相似问题