forked fromdojiland/preq-laravel
- Notifications
You must be signed in to change notification settings - Fork0
Preq is a latency and fault tolerance library for Laravel && Lumen, inspired by Netflix’s Hystrix and upwork/phystrix
License
NotificationsYou must be signed in to change notification settings
llnut/preq-laravel
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Preq is a latency and fault tolerance library for Laravel && Lumen, inspired by Netflix’s Hystrix andupwork/phystrix
Require this package with composer:
composer require per3evere/preq --dev
Add ServiceProvider
add this to the providers array inconfig/app.php
Per3evere\Preq\PreqServiceProvider::class
add this inbootstrap/app.php
$app->register(Per3evere\Preq\PreqServiceProvider::class);
Create service command file
namespaceApp\Services;usePer3evere\Preq\AbstractCommand;class Exampleextends AbstractCommand{/** * 同步执行命令. * * @return void */publicfunctionrun() {return'run!'; }/** * 异步执行命令. * * @return \Guzzlehttp\Promise\Promise; */publicfunctionrunAsync() {// 返回注意返回类型. }}
execute it
$command =app('preq')->getCommand(\App\Services\Example::class);// 同步执行命令echo$command->execute();// 异步执行命令$command->queue();
About
Preq is a latency and fault tolerance library for Laravel && Lumen, inspired by Netflix’s Hystrix and upwork/phystrix
Resources
License
Stars
Watchers
Forks
Packages0
No packages published
Languages
- PHP100.0%