Looks ok.

On Wednesday, July 17, 2019 at 12:53:44 PM UTC-7, Elhanan Maayan wrote:
>
>
>
> hi..
> i'm trying to create a situation, where the channel will always try to 
> connect and re-connect whether the destination is down, or got 
> disconnected, 
>
> so i'm trying to use notifyStateChanged like so:
>
>
> final Grpc.Stub stub= 
> Grpc.newStub(channel).withCallCredentials(callCredentials);
>
> final ConnectivityState state = channel.getState(true);// this should force a 
> connection 
>
>
> channel.notifyWhenStateChanged(ConnectivityState.IDLE, new Runnable() {
>     @Override
>     public void run() {
>         final ConnectivityState state = channel.getState(true);
>         if (ConnectivityState.READY.equals(state)){
>             final StreamObserver<GrpcProtoSpec.EventRecord> observer = 
> createObserver(event, eventTypes);
>             stub.getEvents(request, observer);
>         }
>         channel.notifyWhenStateChanged(state,this);
>     }
> });
>
>
>
> could this be enough?
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/482a2924-726b-4df8-bf07-bd6d390d0aef%40googlegroups.com.

Reply via email to