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/f72e1980-90ca-4033-8473-46731a19292a%40googlegroups.com.

Reply via email to