timiki /
简单的HTTP JSON-RPC客户端
4.1.0
2023-07-09 21:32 UTC
Requires
- php: >=8.1
- ext-json: *
- guzzlehttp/guzzle: ^6.3|^7.1
- psr/event-dispatcher: ^1.0
- timiki/rpc-common: ^1.0|^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- phpstan/phpstan: ^1.5
- phpstan/phpstan-symfony: ^1.1
README
安装
composer require timiki/rpc-client
选项
attempts_on_error (int) - 连接或响应错误时的尝试次数(默认:10)
attempts_on_response_error (bool) - 在响应错误时尝试(默认:false)
attempts_delay (int) - 尝试之间的延迟(毫秒)(默认:1000)
response_on_connection_exception (bool) - 如果设置为true,客户端在连接异常时返回JsonResponse(默认:true)
异步
JSON-RPC Http客户端使用 guzzlehttp/promises 来调用异步函数
callAsync(string $method, array $params = [], array $headers = []): Promise
noticeAsync(string $method, array $params = [], array $headers = []): Promise