Supercharging queues in Laravel with Horizon
View Slide
About meFreek Van der HertenPartner & developer at Spatie@freekmurzemurze.beohdear.app
fullstackeurope.com
Open Source Software
Spatie creates a lot of it± 200 packages on Packagist± 2,300,000 downloads a month± 35,000,000 total downloadsAll Postcardware!
Highlights LaravelPopularlaravel-backuplaravel-medialibrarylaravel-permission
Highlights PHPPopularbrowsershotcrawlerfractalisticimage-optimizer
spatie.be/open-source
spatie.be/open-source/postcards
Let's talk about queues
This talkTiny bit of theoryQueueing basics in LaravelIntroducing Horizon
Theory
Why do we use queues?Users want fast responsesIntensive tasks shouldn't be done inside the requestMove work to a queue
WORKTIMETIMEREQUEST REQUEST WORK
ONE QUEUE MULTIPLE QUEUESQueue 1 Queue 2 Queue 3TIMETIMEWORK A WORK A WORK B WORK CWORK BWORK C
Queues in Laravel
Feature richPrioritiesChainingDelaysTestable
Driver basedDatabase, Redis, Beanstalkd, Amazon SQSCan create your own driverSync driver is handy locally
Demo
IntroducingHorizon
Free first party packageDashboard for queuesSchedulerCode driven configurationLaravel & Redis specific
In closing
SummaryFeature richDriver basedEasy testableHorizon is a powerful tool to manage jobs
Resourcesgithub.com/spatie/laravel-queues-demo-applaravel.com/docs/5.8/queueslaravel.com/docs/5.8/horizonohdear.app/blog/how-to-size-scale-your-laravel-queues
Thank you!speakerdeck.com/freekmurze/horizon-afupspatie.be/open-sourcemurze.beohdear.appfullstackeurope.com