any way to get the state in GrpcChannel
See original GitHub issueIn grpc C# (core library based) , Channel has a State property, which Gets current connectivity state of this channel.
Any way to get the state in grpc-dotnet
https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Core/Channel.cs
/// <summary>
/// Gets current connectivity state of this channel.
/// After channel has been shutdown, <c>ChannelState.Shutdown</c> will be returned.
/// </summary>
public ChannelState State
{
get
{
return GetConnectivityState(false);
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
gRPC Connectivity Semantics and API
All gRPC libraries will expose a channel-level API method to poll the current state of a channel. In C++, this method is called...
Read more >java - getting connection state for GRPC
I am trying to get the connection state for a GRPC (Java API) connection via the call copied below. Based on the notes...
Read more >Call gRPC services with the .NET client
Make gRPC calls. A gRPC call is initiated by calling a method on the client. The gRPC client will handle message serialization and...
Read more >A Deep Dive into Working with gRPC in .NET 6
In this article, I'll look at the basics of gRPC, including how to create a simple service with gRPC in ASP.NET Core application...
Read more >Core concepts, architecture and lifecycle
A channel has state, including connected and idle . How gRPC deals with closing a channel is language dependent. Some languages also permit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is supported in the latest preview*. There is a state property and method to subscribe to state changes.
https://github.com/grpc/grpc-dotnet/blob/7c35727de4e3f4782808021ace55c441783f119d/src/Grpc.Net.Client/GrpcChannel.cs#L520-L581
*Note that it is only available in previews at the moment. Stable versions are skipping this feature until it is properly tested.
@JamesNK when you say its supported in Preview - it looks like we need to compile with SUPPORT_LOAD_BALANCING. Is this kind of a preview compilation tag? Also has been a year, so just wondering when plans would be to incorporate it into main build?