Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Obtaining status of a task(Beanstalk)

Hello community! Please tell me. How can I get status of the task of its identifier?

I get ID:

$id = $queue->put(array('createJob' => mt_rand(1,5)));



Problem solved. Phalcon have special class for this task, but in documentation i not found this:



You can see documents Beanstalk at, Also you can use example my code to see ID

    $job = $this->queue->reserve();
    $message = $job->getBody();
edited Mar '16

One note for Beanstalk / Phalcon implementation.

If you're using reserve() method, it's better to call connect() on each iteration:

//Calling method connect() on a shared MessageBroker instance is the fastest approach

W/o this, your loop gets slow (it seems that the class is trying to find previous connection).