Global Middleware
Array
$haystack = Haystack::build()
->onQueue('podcasts')
->addJob(new RecordPodcast)
->addJob(new ProcessPodcast)
->addMiddleware([
(new RateLimited)->allows(30)->everyMinute(),
new OtherMiddleware,
])
->dispatch();Closure
$haystack = Haystack::build()
->onQueue('podcasts')
->addJob(new RecordPodcast)
->addJob(new ProcessPodcast)
->addMiddleware(function () {
return [
(new RateLimited)->allows(30)->everyMinute(),
new OtherMiddleware,
];
})
->dispatch();Invokable class
Chainable Middleware
Last updated