-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thoughts on adding support for connectivity state #186
Comments
+1. We would like to inform a user/client about the state of a channel at any given time (basically build a channel state UI, nothing more). |
Agreed. I am also working on improving the library's error reporting. For example, if you try to connect to an endpoint that simply does not exist, the library will let you send data just fine in streaming requests and simply throw an |
I've been looking at your PR @MrMage and thanks for being on top of this. I've been working on a different implementation in my fork matching a little bit more what gRPC Python is offering with observers. What are your thoughts on updating the API to use observers? |
My concern with adding an observer is that it adds another polling thread. So running that extra thread should at least be optional I think. |
FWIW |
@dcow sounds interesting. When do these state-change events occur get noticed (and the corresponding callbacks called) in the Java API? |
I don't know the details. Basically you ask a channel to tell you when its state changes from the state you pass in. So I'd say, "channel tell me when you're no longer in the |
Yes, it's exactly what I was suggesting with observers (what the C lib is calling watcher). Here is a sample code of my implementation and how I use it
|
Can you share that code so we can look at it? :-) |
What would be a good way to verify this (in tests)? When this was verified during development, how many states were observable? |
Closing this issue since #196 and Timing-GmbH@e68cec0 are adding support for this. |
This Swift library doesn't expose connectivity states and doesn't include an API to watch state changes: https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md
The text was updated successfully, but these errors were encountered: