1

If I have two workers listening on a single tube and a job comes through, will both workers attempt to handle the same job, or will it get claimed only by one?

Ian
  • 1,498
  • 4
  • 26
  • 32

1 Answers1

2

Only one worker will claim your job. So it's one by one.

A job in beanstalk gets created by a client with the "put" command. During its life it can be in one of four states: "ready", "reserved", "delayed", or "buried". After the put command, a job typically starts out ready. It waits in the ready queue until a worker comes along and runs the "reserve" command. If this job is next in the queue, it will be reserved for the worker. The worker will execute the job; when it is finished the worker will send a "delete" command to delete the job.

A worker that wants to consume jobs from the queue uses "reserve", "delete", "release", and "bury".

Pentium10
  • 444
  • 1
  • 9
  • 23