limingxinleo / swoft-rpc
Swoft
Installs: 1 393
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/limingxinleo/swoft-rpc
Requires
- php: >=7.0
 - swoft/framework: ^1.0.24
 - swoft/rpc-client: ^1.0
 - swoft/service-governance: ^1.0
 
Requires (Dev)
- phpunit/phpunit: ^5.7
 - swoft/swoole-ide-helper: dev-master
 
This package is auto-updated.
Last update: 2025-10-29 02:29:40 UTC
README
用于封装常用的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\\'
        ],
    ],
];