We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Beanstalk reserve can't get job from queue!

$queue = new Beanstalk($this->config->queue->toArray());
$queue->connect();
$queue->choose($this->config->queue->tube);
while(($job = $queue->reserve()) !== false) {
    $jobBody = $job->getBody();
    var_dump($jobBody);
    //Remove the job from the queue
    $job->delete();
}

[peekReady] can get jobs, but [reserve] don't give any response.



1.1k

Thank you very much.

I missed a line of code

$queue->watch('myque')

Refer to this topic: https://forum.phalcon.io/discussion/14625/q

You can mark Jonathan's answer as correct and solve the thread.