承接 per3evere/preq 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

per3evere/preq

最新稳定版本:v2.0.0

Composer 安装命令:

composer require per3evere/preq

包简介

Microservices IPC command factory for Laravel && Lumen

README 文档

README

Build Status

About Preq

Preq is a latency and fault tolerance library for Laravel && Lumen, inspired by Netflix’s Hystrix and upwork/phystrix

Installation

Require this package with composer:

composer require per3evere/preq --dev

Add ServiceProvider

Laravel

add this to the providers array in config/app.php

Per3evere\Preq\PreqServiceProvider::class

Lumen

add this in bootstrap/app.php

$app->register(Per3evere\Preq\PreqServiceProvider::class);

Usage

Create service command file

namespace App\Services;

use Per3evere\Preq\AbstractCommand;

class Example extends AbstractCommand
{
    /**
     * 同步执行命令.
     *
     * @return void
     */
    public function run()
    {
        return 'run!';
    }

    /**
     * 异步执行命令.
     *
     * @return \Guzzlehttp\Promise\Promise;
     */
    public function runAsync()
    {
        // 返回注意返回类型.
    }
}

execute it

$command = app('preq')->getCommand(\App\Services\Example::class);

// 同步执行命令
echo $command->execute();

// 异步执行命令
$command->queue();

统计信息

  • 总下载量: 3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-13