Closed VerTiGoEtrex closed 1 year ago
When do dart-grpc streams first open a connection to the server?
When you call the method on your service stub. Whether or not you are listening on the stream does not matter, the call is already in progress at that point.
Currently ResponseStream
does not expose any lifecycle events, but you could listen on stream.headers
Future
- once that completes the call has connected.
My end goal is to "resubscribe" to a stream with different parameters, without interruption.
First, a question illustrated by some client-side dart. When do dart-grpc streams first open a connection to the server?
If I want to resub without interruption, I feel I'm missing a trigger/callback in the current API.
To be able to resubscribe without interruption, I need this:
From what I can tell, there's no way to be signaled that "stream actually ready" has occurred.
If I had control of the server, I could always send a dummy message as the first message to signal the stream is ready, but I don't control the server. For completeness, this is what that would look like:
Is there some other way I can ensure that the old stream is not discarded before the new one is ready without having to create some initial dummy message for the next stream to emit a message as a signal that it's ready to go, or waiting for a "first message" which may never be sent in some instances (e.g. if the stream is empty given some set of parameters?)