4

Can someone explain what $job->release() does in Laravel 4.2? I understand that it will "release a job back onto the queue", but what does this actually mean? Does this mean the job is put back first in line on the queue? So it will immediately run again?

flyingL123
  • 7,686
  • 11
  • 66
  • 135

2 Answers2

7

Based on my testing using beanstalkd as the queue service, it looks like $job->release() will cause the job to put back on the queue in the first position. Meaning, it will be immediately executed again. If you release with a delay, using $job->release(5), then the released job will be delayed, allowing other jobs on the queue to be processed before it.

flyingL123
  • 7,686
  • 11
  • 66
  • 135
1

Depends on the queue service, but normally it'll put the job back at the end of the queue.

Andreas
  • 7,991
  • 2
  • 28
  • 37