arxeiss/sansdaemon

Batch process Laravel Queue without a daemon; Processes queue jobs and kills the process
6,301 9
Install
composer require arxeiss/sansdaemon
Latest Version:v1.3.2
PHP:^8.0
License:MIT
Last Updated:Apr 25, 2026
Links: GitHub  ·  Packagist
Maintainer: arxeiss

SansDaemon

This is fork of https://github.com/orobogenius/sansdaemon which wasn't maintained anymore.

PHP from Packagist Packagist Version Illuminate Version Build codecov PHP STAN

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. Or when you want to run queue jobs on some routes.

Installation

To install the latest version of SansDaemon, simply use composer

Download

composer require arxeiss/sansdaemon

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:

  • --sansdaemon option tell the worker to process jobs on the queue without running in daemon mode.
  • --jobs (default: 0, optional) - It allows you to specify the number of jobs to process each time the command runs. The default value 0 means it'll process all available jobs in the queue.
  • --max_exec_time (default: ini_get('max_execution_time') - 5s, optional) - On some webhosts, your scripts will be killed, if it exceeds some amount of time. To prevent this behavior on really full queue, worker will stop after --max_exec_time. This is especially useful if you're running this command via your application's route or controller. See Laravel Documentation on how to run your queue programmatically.
Note on --max_exec_time
  • 0 (zero) means the worker will run forever, which in this context means until the worker process is done. This is the default behavior when run from CLI.
  • This option will not prevent Maximum execution time exceeded error, it'll try to avoid it by not running the next job on the queue if the script is reaching its max_execution_time.

Contributing

Feel free to open PR, just make sure you pass all tests and checks.

composer test
composer lint
composer stan

Related Packages

maqe/laravel-sqs-fifo

Laravel package that enables support for SQS FIFO Queue

141,216 15
ytake/laravel-couchbase

Couchbase providers for Laravel

52,526 30
bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2,787,132 281
yozaz/laravel-swiftmailer

Laravel and SwiftMailer integration fix for Queued deamon workers

73,993 24
spatie/laravel-failed-job-monitor

Get notified when a queued job fails

3,082,041 1,057

Version History

Version Released PHP Laravel License
v1.3.2 ^8.0 ^9.5 | ^10.0 | ^11.0 | ^12.0 | ^13.0 MIT
v1.3.1 ^8.0 ^9.5 | ^10.0 | ^11.0 | ^12.0 MIT
v1.3.0 ^8.0 ^9.5 | ^10.0 | ^11.0 MIT