orobogenius / sansdaemon

Batch process Laravel Queue without a daemon; Processes queue jobs and kills the process
https://medium.com/@orobogenius/laravel-queue-processing-on-shared-hosting-dedd82d0267a
MIT License
176 stars 17 forks source link
laravel laravel-queues php queue queue-workers shared-host worker-process

SansDaemon

Build Status Latest Stable Version Total Downloads License

Introduction

Batch process Laravel Queue without a daemon; Processes all jobs on the queue(s) and exits without running on daemon mode. This is useful in cases where you just want to process jobs on the queue and exit the worker process so they don't pile up in memory.

Installation

To install the latest version of SansDaemon, simply use composer

Download

composer require queueworker/sansdaemon
Queueworker\SansDaemon\SansDaemonServiceProvider::class,

Usage

SansDaemon is a console application that extends the functionality of laravel's WorkCommand - Illuminate\Queue\Console\WorkCommand. See Laravel Queue documentation.

To run the queue worker sans-daemon mode, simply add the --sansdaemon option to the original laravel queue worker command:

php artisan queue:work --sansdaemon

Argument and Options

Since this package extends laravel's WorkCommand, it takes exactly all the arguments and options the original WorkCommand takes with three added options:

Note on --max_exec_time

Testing

composer test

License

MIT license (MIT) - Check out the License File for more.