swoole / grpc

💎 Grpc client based on Swoole Coroutine
Apache License 2.0
199 stars 20 forks source link

Fix correct channel capacity for openswoole extension #31

Closed cragonnyunt closed 2 years ago

cragonnyunt commented 2 years ago

According to Openswoole documentation,

capacity
   Set the channel max capacity, must be greater than or equal to 1.

Ref link - https://openswoole.com/docs/modules/swoole-coroutine-channel-construct

Which causes grpc clients to break between servers.

[2022-01-27 16:40:43] local.ERROR: Swoole\Coroutine\Channel::__construct(): capacity is invalid {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Swoole\\Coroutine\\Channel::__construct(): capacity is invalid at /var/www/vendor/swoole/grpc/src/Grpc/Client.php:207)
[stacktrace]
#0 {main}

This PR can fix above bug.