meisendev/laravel-daemon
Composer 安装命令:
composer require meisendev/laravel-daemon
包简介
Runs as sentinel for a list of daemon commands
README 文档
README
Runs as sentinel for a list of daemon commands
In practice, a project can have a number of commands to be executed in a pre-determined schedule. Some commands need to be executed at a given interval, some need to run more than one instance in parallel, some need to automatically send alert when execution fails, and so on. This library provides a very useful feature called the Daemon Sentinel just to solve this problem.
This library based on oasis/slimapp and custom-made for laravel framework.
Quick Start
In your laravel project:
composer require meisendev/laravel-daemon
Add sentinel command to App\Console\Kernel like this:
class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ TestDaemon1::class, \Meisendev\LaravelDaemon\DaemonSentinelCommand::class, ]; }
Add config file(e.g. meisendev.php) to config folder.
meisendev.php setup like this:
<?php return [ 'test:daemon:1' => [ 'name' => 'test:daemon:1',//regular Artisan command signature, note: the name without args 'once' => false,//run only once? if not, command will restart upon previous execution ends 'parallel' => 5,//how many parallel 'args' => [//regular Artisan command args like: 'test:daemon:1 {arg1} {arg2}' 'arg1' => 'test1', 'arg2' => 'test11' ], 'interval' => 3,//minimum number of seconds between last end and next start 'alert' => true ], 'test:daemon:2' => [ 'name' => 'test:daemon:2', 'once' => true, 'parallel' => 8, 'args' => [ 'arg1' => 'test2' ], 'frequency' => '3',//minimum seconds between two start 'alert' => true ] ];
Run sentinel command like this:
php artisan sentinel:run meisendev
meisendev is the config file name
Note: You'd better run above command with screen!
meisendev/laravel-daemon 适用场景与选型建议
meisendev/laravel-daemon 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「console」 「laravel」 「daemon」 「sentinel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 meisendev/laravel-daemon 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 meisendev/laravel-daemon 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 meisendev/laravel-daemon 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
A table generator class for the PHP CLI.
Alfabank REST API integration
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-15