grpc-dart
grpc-dart copied to clipboard
Expose onStateChanged from Http2ClientConnection
Right now this field is marked as visibleForTesting
. But it would be awesome to monitor the state of the stream and even expose a Stream<ConnectionState>
.
Up, why is this only visible for testing ?
Yes, please! one use case is when the connection is restored we can dequeue the failed/pending requests and send them again.
This would be great to have on the channel, similar to how it's done in the python implementation (https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_channel.py#L1493).
Any update on that?
It seems pretty essential to be able to know the state of the current connection. I'm using gRPC for a Flutter app and being able to show the current connection state to the user is an important feature.
Looks like this has been fixed with #565 (3.1.0).
@mraleph @micheljung @Cobinja Thanks a lot,
This offers a Stream on channels. Only for Http2Channel, not for web usage.
Could be nice to add comment about Web at least, as onConnectionStateChanged
property available for all platforms currently.
And maybe create issue to implement it it for Web in future.
Could be nice to add comment about Web at least, as
onConnectionStateChanged
property available for all platforms currently.
It is documented on the property itself.