Back2Lobby
Back2Lobby

Reputation: 593

What is Job Overlapping in Laravel?

I was reading the Laravel Docs at Job Overlap Section. But I don't get it how the jobs can overlap. If I am right, Jobs are processed one by one. Then there is no reason for them to overlap.

According to docs:

This can be helpful when a queued job is modifying a resource that should only be modified by one job at a time

My concept about it is not that clear yet, so any help will be appreciated.

Upvotes: 0

Views: 517

Answers (1)

bumperbox
bumperbox

Reputation: 10214

The jobs sit in a queue,

Example. Job1, Job2, Job3, Job4, Job5

If you have 1 worker consuming the queue, then your jobs will never overlap

Job1 would have to be completed before it can start Job2

If you have more than 1 worker, say you have 3 workers consuming the queue then Job1, Job2, Job3 will all be processed at the same time.

This is when overlap can occur.

Upvotes: 1

Related Questions