• 配置参数

    配置参数

    1. return [
    2. 'user' => [
    3. 'class' => ServiceClient::class,
    4. 'host' => '127.0.0.1',
    5. 'port' => 18307,
    6. 'setting' => [
    7. 'timeout' => 0.5,
    8. 'connect_timeout' => 1.0,
    9. 'write_timeout' => 10.0,
    10. 'read_timeout' => 0.5,
    11. ],
    12. 'packet' => bean('rpcClientPacket')
    13. ],
    14. 'user.pool' => [
    15. 'class' => ServicePool::class,
    16. 'client' => bean('user')
    17. ],
    18. ];

    如上定义了一个 user 服务,连接池配置参数和其它一样。