rakko-inc / laravel-graceful-schedule-worker
Installs: 161
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rakko-inc/laravel-graceful-schedule-worker
Requires
- php: ^7.2.5 || ~8.0
- ext-pcntl: *
- illuminate/console: ^6.0 || ^7.0
- illuminate/support: ^6.0 || ^7.0
- symfony/console: ^4.4 || ^5.4
- symfony/process: ^4.4 || ^5.4
Requires (Dev)
- phpunit/phpunit: ^8.5.40 || ^9.6.21
This package is auto-updated.
Last update: 2025-12-09 02:03:29 UTC
README
A lightweight Laravel 6 & 7 package that turns schedule:run into a long-running,
gracefully-stoppable worker.
Overview
Run:
php artisan schedule:graceful-work
The command:
- Spawns
php artisan schedule:runat the start of every minute. - Streams the child process output directly to your console.
- Listens for
SIGINT/SIGTERM(e.g.,Ctrl+C,kill) and exits gracefully after stopping any running task.
Optional flag:
php artisan schedule:graceful-work --run-output-file=/path/to/schedule.log
Demo
A ready-to-run sample application is located in the demo/ directory.
Start a server without Docker
$ cd demo
$ composer install
$ cp .env.example .env
$ php artisan key:generate
$ php artisan schedule:graceful-work
Start a server with Docker
$ cd demo $ docker compose up [+] Running 1/1 ✔ Container demo-php-1 Recreated 0.1s Attaching to php-1 php-1 | Running scheduled tasks. php-1 | Running scheduled command: '/usr/local/bin/php' 'artisan' hello >> '/app/storage/logs/scheduler.log' 2>&1 php-1 | [2025-05-07 16:28:00] local.INFO: hello start from Scheduler. php-1 | Hello World! php-1 | [2025-05-07 16:28:00] local.INFO: Hello World! php-1 | [2025-05-07 16:28:00] local.INFO: hello successful. php-1 | [2025-05-07 16:28:00] local.INFO: hello finished.