grpc-dart icon indicating copy to clipboard operation
grpc-dart copied to clipboard

Expose onStateChanged from Http2ClientConnection

Open long1eu opened this issue 4 years ago • 4 comments

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>.

long1eu avatar Jan 24 '21 03:01 long1eu

Up, why is this only visible for testing ?

mathisfouques avatar Mar 28 '22 14:03 mathisfouques

Yes, please! one use case is when the connection is restored we can dequeue the failed/pending requests and send them again.

shekohex avatar Apr 29 '22 23:04 shekohex

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).

Cobinja avatar May 09 '22 10:05 Cobinja

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.

Ludonope avatar Jun 22 '22 15:06 Ludonope

Looks like this has been fixed with #565 (3.1.0).

micheljung avatar Apr 01 '23 19:04 micheljung

@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.

zs-dima avatar Apr 11 '23 17:04 zs-dima

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.

mraleph avatar Apr 12 '23 08:04 mraleph