rakko-inc/laravel-graceful-schedule-worker
最新稳定版本:0.1.0
Composer 安装命令:
composer require rakko-inc/laravel-graceful-schedule-worker
包简介
README 文档
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.
统计信息
- 总下载量: 176
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-27