There is a reason for the API design of ClientInterceptors.intercept(..) 
returning a Channel rather than ManagedChannel: The original managed 
channel is the single entity that is responsible for the life-cycle of the 
channel. If you are not the owner of the original ManagedChannel instance, 
you are not responsible and should not shut it down. If you are owner of 
the original ManageChannel, you are responsible to shut it down, and you 
need pass the reference to the original ManagedChannel to the caller of 
shutdown().

That might be very inconvenient in some cases, but that's how it is 
supposed to work.

On Monday, August 3, 2020 at 10:13:01 PM UTC-7 [email protected] wrote:

> ManagedChannel has shutdown()
> However, our code adds an interceptor with ClientInterceptors.intercept(..) 
> which returns a Channel, which doesn't have shutdown. 
>
> It seems we're doing it wrong. But what's the right way to have a 
> cloasable client with an interceptor?
>
> Thank you!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/32186fdd-4a45-4e9e-8594-ca989ad6abd5n%40googlegroups.com.

Reply via email to