grpc-dart icon indicating copy to clipboard operation
grpc-dart copied to clipboard

Question: Best practice for using ClientChannel

Open payam-zahedi opened this issue 1 year ago • 4 comments

Hey everyone thanks for this awesome library

What is the best practice when we are using ClientChannel?

Should have a ClientChannel for each call and shutdown the connection after the call finished? Should we have a ClientChannel per ServiceClients? Should We have a single ClientChannel for everything?

When do we need to shutdown the ClientChannel?

payam-zahedi avatar May 03 '24 14:05 payam-zahedi

@mraleph Can you help us in here ?

payam-zahedi avatar May 06 '24 07:05 payam-zahedi

The connection should be managed by the channel, see the getConnection() method.

Or am I misunderstanding @payam-zahedi?

mosuem avatar Jun 12 '24 14:06 mosuem

Thanks @mosuem for response

I'm sorry I used ClientCollection instead of ClientChannel

I'll Update the issue

payam-zahedi avatar Jun 21 '24 07:06 payam-zahedi

@wenbozhu Is there any cross-language guidance on the lifecycle of gRPC channels?

mosuem avatar Jun 21 '24 08:06 mosuem