grpc / grpc-dart

The Dart language implementation of gRPC.
https://pub.dev/packages/grpc
Apache License 2.0
835 stars 256 forks source link

Question: Best practice for using ClientChannel #709

Open payam-zahedi opened 1 month ago

payam-zahedi commented 1 month ago

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 commented 1 month ago

@mraleph Can you help us in here ?

mosuem commented 2 weeks ago

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

Or am I misunderstanding @payam-zahedi?

payam-zahedi commented 1 week ago

Thanks @mosuem for response

I'm sorry I used ClientCollection instead of ClientChannel

I'll Update the issue

mosuem commented 1 week ago

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