limingxinleo/swoft-rpc

1.0.1 2018-11-03 10:25 UTC

This package is auto-updated.

Last update: 2024-10-29 04:53:35 UTC


README

Build Status

用于封装常用的Breaker和ServicePool

自定义的Breaker和ServicePool需要继承当前类库进行实现。

安装

composer require limingxinleo/swoft-rpc

基本配置 app.php

return [
    ...
    'service' => [
        'default' => [
            'name' => 'service',
            'uri' => [
                '127.0.0.1:8099',
                '127.0.0.1:8099',
            ],
            'minActive' => 8,
            'maxActive' => 8,
            'maxWait' => 8,
            'maxWaitTime' => 3,
            'maxIdleTime' => 60,
            'timeout' => 8,
            'useProvider' => false,
            'balancer' => 'random',
            'provider' => 'consul',
        ]
    ],
    'breaker' => [
        'default' => [
            'failCount' => 3,
            'successCount' => 3,
            'delayTime' => 500,
        ],
    ],
    'components' => [
        'custom' => [
            'Swoftx\\Rpc\\'
        ],
    ],
];