tripteki/laravelphp-supervisor
最新稳定版本:1.0.0
Composer 安装命令:
composer require tripteki/laravelphp-supervisor
包简介
Trip Teknologi's Laravel.php Supervisor
README 文档
README
This package provides supervisor-like, async-like, child-process-like, etc to build event-listener driven with little painless for your Laravel Project.
Getting Started
Installation :
$ composer require tripteki/laravelphp-supervisor
$ npm install pm2 && npm install --save-dev chokidar
$ pecl install swoole
How to use :
- Publish config file into your project's directory with running :
php artisan vendor:publish --tag=tripteki-laravelphp-supervisor
Usage
php artisan supervisor:<option>
Option
start ...: Start the supervisor.- foreground (default)
- background
reload: Reload the background supervisor.stop: Stop the background supervisor /ctrl + cfor foreground supervisor.status: Show the status of background supervisor.startup: Generateecosystem.jsonsupervisor startup configuration, do not forget to stop your supervisor process perproject, then see this to know how to get started.
Snippet
/** Use asynchronous? */ __async__(function () { Model::truncate(); });
/** Use asynchronous await-like to get variable? */ [ $model, ] = __async__(fn () => Model::all());
/** Use setInterval? */ __setInterval__(function () { Model::truncate(); }, 2000);
/** Use setImmediate? */ __setImmediate__(function () { Model::truncate(); }, 2000);
/** Use exec as replace temporary process? */ $os = __exec__("uname -a");
/** Use spawn as one way communication child process? */ /** Stdin stream handler... */ $stdin = fopen("php://temporary", "w+"); fwrite($stdin, "Foo..."); fwrite($stdin, "Bar..."); fwrite($stdin, "Baz..."); fclose($stdin); /** Stdout handler... */ $stdout = function ($isError, $data) { if ($isError) { // $isError // } // $data // }; __spawn__("python3 example.py", $environment = [], $stdout, $stdin);
Author
- Trip Teknologi (@tripteki)
- Hasby Maulana (@hsbmaulana)
统计信息
- 总下载量: 181
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-30