Hi, I'm using gRPC with the cloud speech API (v1beta1). In my app, at a certain point, I need to stream the audio to the speech service and get the results as fast as I can. For that, I need the managed-channel to be up and ready before streaming. The wiring of everything (creating the managed channel, creating the SpeechStub, the response stream observer and the request observer) takes roughly 500ms. 500ms is too much for my app to wait before streaming. This is why I prepare everything before and I make sure that at the end of a recognition operation the full structure is prepared for the next iteration. However, I've noticed that given a long enough idle wait (don't know how long, matter of minutes) of the channel, if I try to stream the audio, everything acts as if all is well but I don't get any response (to beginning of speech nor transcripts nor any error). I hypothesised that it has to do with the connectivity state/idle state of the channel and decided that I'll constantly shut the channel down and reconnect in 1 minute intervals (given of course that it's not busy). This solved the problem - but it's a workaround of course. Is there a way to know what's the state of the channel? I saw that grpc-java issue #28 should address this issue with the ManagedChannel.getState/notifyWhenStateChanged APIs (rel 1.2.0) but it's not implemented yet. I also saw that there's a health check protocol (https://github.com/grpc/grpc/blob/master/doc/health-checking.md) - does this feature work? would it be suitable for my needs?
When is the state API is expected to land? I think that going forward this is the way to go from our app's perspective. Thanks, David. -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/b11dc37a-0e7e-4b71-b5a2-2b680bcc7662%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
