public class ReactorNettyTcpClient<P> extends Object implements TcpOperations<P>
TcpOperations.| Constructor and Description |
|---|
ReactorNettyTcpClient(Consumer<reactor.ipc.netty.options.ClientOptions.Builder<?>> optionsConsumer,
ReactorNettyCodec<P> codec)
Alternate constructor with a
ClientOptions.Builder> consumer
providing additional control beyond a host and a port. |
ReactorNettyTcpClient(String host,
int port,
ReactorNettyCodec<P> codec)
Basic constructor with a host and a port.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.util.concurrent.ListenableFuture<Void> |
connect(TcpConnectionHandler<P> handler)
Open a new connection.
|
org.springframework.util.concurrent.ListenableFuture<Void> |
connect(TcpConnectionHandler<P> handler,
ReconnectStrategy strategy)
Open a new connection and a strategy for reconnecting if the connection fails.
|
org.springframework.util.concurrent.ListenableFuture<Void> |
shutdown()
Shut down and close any open connections.
|
public ReactorNettyTcpClient(String host, int port, ReactorNettyCodec<P> codec)
public ReactorNettyTcpClient(Consumer<reactor.ipc.netty.options.ClientOptions.Builder<?>> optionsConsumer, ReactorNettyCodec<P> codec)
ClientOptions.Builder> consumer
providing additional control beyond a host and a port.public org.springframework.util.concurrent.ListenableFuture<Void> connect(TcpConnectionHandler<P> handler)
TcpOperationsconnect in interface TcpOperations<P>handler - a handler to manage the connectionpublic org.springframework.util.concurrent.ListenableFuture<Void> connect(TcpConnectionHandler<P> handler, ReconnectStrategy strategy)
TcpOperationsconnect in interface TcpOperations<P>handler - a handler to manage the connectionstrategy - a strategy for reconnectingpublic org.springframework.util.concurrent.ListenableFuture<Void> shutdown()
TcpOperationsshutdown in interface TcpOperations<P>