Package com.eventstore.dbclient
Class GrpcClient
- java.lang.Object
-
- com.eventstore.dbclient.GrpcClient
-
- Direct Known Subclasses:
EventStoreDBClusterClient,SingleNodeClient
public abstract class GrpcClient extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected io.grpc.ManagedChannelchannelprotected java.util.UUIDcurrentChannelIdprotected java.lang.ExceptionlastExceptionprotected EventStoreDBClientSettingssettingsprotected booleanshutdownprotected io.grpc.netty.shaded.io.netty.handler.ssl.SslContextsslContext
-
Constructor Summary
Constructors Modifier Constructor Description protectedGrpcClient(EventStoreDBClientSettings settings, io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected io.grpc.ManagedChannelcreateChannel(Endpoint endpoint)protected java.util.concurrent.ExecutorcreateConnectionLoopExecutor()protected abstract booleandoConnect()protected voidpushMsg(com.eventstore.dbclient.GrpcClient.Msg msg)<A> java.util.concurrent.CompletableFuture<A>run(java.util.function.Function<io.grpc.ManagedChannel,java.util.concurrent.CompletableFuture<A>> action)voidshutdown()protected voidsleep(long millis)protected voidstartConnectionLoop()
-
-
-
Field Detail
-
settings
protected final EventStoreDBClientSettings settings
-
sslContext
protected final io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext
-
channel
protected io.grpc.ManagedChannel channel
-
lastException
protected java.lang.Exception lastException
-
currentChannelId
protected java.util.UUID currentChannelId
-
shutdown
protected volatile boolean shutdown
-
-
Constructor Detail
-
GrpcClient
protected GrpcClient(EventStoreDBClientSettings settings, io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext)
-
-
Method Detail
-
startConnectionLoop
protected void startConnectionLoop()
-
createConnectionLoopExecutor
protected java.util.concurrent.Executor createConnectionLoopExecutor()
-
doConnect
protected abstract boolean doConnect()
-
pushMsg
protected void pushMsg(com.eventstore.dbclient.GrpcClient.Msg msg)
-
run
public <A> java.util.concurrent.CompletableFuture<A> run(java.util.function.Function<io.grpc.ManagedChannel,java.util.concurrent.CompletableFuture<A>> action)
-
sleep
protected void sleep(long millis)
-
createChannel
protected io.grpc.ManagedChannel createChannel(Endpoint endpoint)
-
shutdown
public void shutdown() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
-