In my services.php I have:
$di->set('queue', function () use ($config){
$queue = new \Phalcon\Queue\Beanstalk([
$config->queue->host,
$config->queue->port,
$config->queue->persistent
]);
return $queue;
});
To put a job onto the queue "email" I:
$this->queue->choose("email");
$this->queue->put($to_notify);
I have verified the job is in tube 'email' via Chrome Browser App Beanstalkd Dashboard:
The problem I am having is that the script I have freezes when attempting to reserve a job after choosing the email tube from the queue.
$this->queue->choose('email');
while (true) {
while ($this->queue->peekReady() !== false) {
$job = $this->queue->reserve(); //script freezes here!!!
}
}