Skip to content

Glossary

Laravel queues: work that happens in the background

A mechanism for taking time-consuming tasks out of the request and having them worked off later.

Some work takes too long to leave somebody waiting in front of a screen. A hundred-page PDF. A thousand emails. An upload to somebody else’s system. A queue separates the starting from the doing.

The sequence is plain. The request files a job in the queue and answers straight away. A separate process, the worker, takes jobs out and works them off. If something goes wrong, the job is tried again.

What this means in production

Queues are not purely a development matter; they change how the thing is run. There is now an additional permanently running process that has to be watched and restarted after a deployment, because otherwise it carries on working with the old code.

In applications that have grown over years, the most common fault is not a broken job. It is a worker that has not been running for weeks. From the outside everything looks normal; in the background nothing is happening any more. So queue length and the number of failed jobs are among the figures we keep an eye on under maintenance.

FAQ

Häufige Fragen

What happens when a job fails?
After a set number of attempts it is filed as failed, together with the error, and can be started again deliberately. What matters is that somebody looks in that file; otherwise work that never happened piles up there quietly.

Related

Terms that belong with this one

A project, or a question?

Write and tell us what it is about. You get an assessment from somebody who works with Laravel themselves, not from a sales desk.