You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In both the GRPC and HTTP clients channels/sessions are created for every single request. Both GRPC and AIOHTTP recommend reusing channels/sessions for the lifecycle of the application.
In both cases the channel/session encapsulates a connection pool. If a new channel/session is created for every request this connection pool must also be recreated. This leads to performance which is poorer than it could be.
Additionally, to really fix this problem each client needs to have its own implementation of _sync_call which is distinct from _call. Using asyncio.run in the background causes problems. It might be simpler and clearer to separate the clients into AsyncHTTPClient, HTTPClient, AsyncGrpcClient, and GrpcClient. Each of which could handle its simpler case.
To reproduce
No response
Expected behavior
Reuse of channels/sessions
Environment
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
In both the GRPC and HTTP clients channels/sessions are created for every single request. Both GRPC and AIOHTTP recommend reusing channels/sessions for the lifecycle of the application.
In both cases the channel/session encapsulates a connection pool. If a new channel/session is created for every request this connection pool must also be recreated. This leads to performance which is poorer than it could be.
Additionally, to really fix this problem each client needs to have its own implementation of
_sync_call
which is distinct from_call
. Usingasyncio.run
in the background causes problems. It might be simpler and clearer to separate the clients intoAsyncHTTPClient
,HTTPClient
,AsyncGrpcClient
, andGrpcClient
. Each of which could handle its simpler case.To reproduce
No response
Expected behavior
Reuse of channels/sessions
Environment
N/A
The text was updated successfully, but these errors were encountered: