Laravel Queue Debouncer package allows any queue job or chain in your Laravel application to be debounced, meaning that no matter how many times it’s dispatched within the specified timeout window, it will only run once. For example, imagine you dispatch a job to rebuild a cache every time a record is updated, but the job is resource intensive. Debouncing the job with a five-minute wait would ensure that the cache is only rebuilt once, five minutes after you finish making changes.

Debounced jobs can largely be treated like any other dispatched job.

Facade use App\Jobs\MyJob; use Mpbarlow\LaravelQueueDebouncer\Facade\Debouncer; Debouncer::debounce(new MyJob, 30); Helper function use App\Jobs\MyJob; debounce(new MyJob(), 30); When monitoring the queue, you will see an entry for the package’s internal dispatcher each time the debounced job is queued, but the job itself will only run once when the final wait time has expired.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners