Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

The difference between reserved and buried jobs in beanstalk tubes is as simple as explanation below.


Reserved


When a job is "reserved" (happens when it doesn't reach the consumer - handled with example PHP code below), you'll have to run more workers so that the job can be processed. If you don't run more workers, all the previously "reserved" and new jobs will be blocked in the tube.


$tube = 'say_hello';
$watchTimeout = 60; // Reserve for 60 seconds before trying again
$this->pheanstalk->watch($tube)->ignore('default')->reserve($watchTimeout);

Buried


When a job is "buried" (happens if something goes wrong while consumer processes it - handled with example PHP code below), you'll have to manually kick it so that it can be processed. Having "buried" jobs in a tube doesn't affect new jobs so tube is functional.


$tube = 'say_hello';
$watchTimeout = 60; // Reserve for 60 seconds before trying again
$job = $this->pheanstalk->watch($tube)->ignore('default')->reserve($watchTimeout);
$this->pheanstalk->bury($job);

Outcome


So all you have to do is, if there is a "reserved" job in tube, run more workers. If there is a "buried" job in tube, manually kick it.