even though i'm using shaded netty, this seems the only i way i could find 
to know about any connection problems while using waitForReady, how safe is 
it to be used ?


final ManagedChannel connectorChannel = NettyChannelBuilder.forAddress(host, 
443).sslContext(sslContext).withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
5000)

        .channelFactory(new ChannelFactory<Channel>() {
            @Override
            public Channel newChannel() {
                final NioSocketChannel nioSocketChannel = new 
NioSocketChannel() {
                    @Override
                    public ChannelFuture connect(SocketAddress remoteAddress) {
                        final ChannelFuture connect = 
super.connect(remoteAddress);
                        
connect.addListener((GenericFutureListener<ChannelFuture>) channelFuture -> {
                            final Throwable cause = channelFuture.cause();
                            if (cause!=null){
                                cause.printStackTrace();
                            }
                        });
                        return connect;
                    }
                };

                return nioSocketChannel;

            }
        })
        .build();

final FirehoseGrpc.FirehoseStub stub = 
FirehoseGrpc.newStub(connectorChannel).withCallCredentials(getCredentials(apiKey)).withWaitForReady()

-- 
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/2914b2b2-c981-439e-9591-c55ae97dbc10%40googlegroups.com.

Reply via email to