Back Button Laravel

Queue it Up

Learning about queues can be a daunting task. It's not fun to be met with confusing jargon that you can't decipher. But that's what I'm here for. Let's incrementally break it all down into small steps that anyone can understand. In no time, you'll be throwing delayed jobs onto the queue like a pro.

Intermediate
Difficulty
8 episodes
41:05 mins
Start Series
  • Latest Episode: Storing Jobs in the Database

  • Like this series? Share the love!

  • 01

    Episode 1 Run Time 2:27

    Before we write a single line of code, give me two minutes to provide a real-life illustration of queues and workers. We'll use the example of a pizza delivery restaurant.

  • 02

    Episode 2 Run Time 6:58

    Now that you have a basic idea of what a queue is, let's dispatch our first job using Laravel. We'll also learn about delayed job execution, and when you might reach for it.

  • 03

    Episode 3 Run Time 8:16

    Now that you understand how to dispatch a simple closure, let's next create a dedicated Job class, while discussing serialization and daemons.

  • 04

    Episode 4 Run Time 1:18

    We've learned how to use the global dispatch() function, but there's an alternative option you should consider as well. By default, each Job class includes a Dispatchable trait.

  • 05

    Episode 5 Run Time 5:05

    So far, we've reviewed the "happy path" for a job, but what if an error or exception is thrown along the way? If you don't specify a maximum number of tries for your queue worker, the job will retry over and over again. In this episode, we'll learn how to fix this by creating a "failed_jobs" table.

  • 06

    Episode 6 Run Time 6:54

    When working with queues, it can often prove difficult to see what's happening. For example, how many jobs ran in the last hour? Did any of them fail? How many workers are running? And what about only the jobs that match a particular tag? Let's solve this by installing Laravel Horizon, a dashboard for your Redis-backed queues.

  • 07

    Episode 7 Run Time 7:33

    In this episode, we'll review how to create multiple queue stacks and workers, as well as when and why you might do so.

  • 08

    Episode 8 Run Time 2:34

    If you don't have much control over the environment your application runs in, you might consider using the database queue connection. With this approach, rather than using Redis or Memcached, your jobs will instead be stored and fetched from the database.

*Series still in development. Check back often for updates.