public class ReactorNettyTcpClient<P> extends java.lang.Object implements TcpOperations<P>
TcpOperations.| Constructor and Description |
|---|
ReactorNettyTcpClient(java.util.function.Consumer<reactor.ipc.netty.options.ClientOptions.Builder<?>> optionsConsumer,
ReactorNettyCodec<P> codec)
Constructor with a
ClientOptions.Builder that can be used to
customize Reactor Netty client options. |
ReactorNettyTcpClient(java.lang.String host,
int port,
ReactorNettyCodec<P> codec)
Simple constructor with a host and a port.
|
ReactorNettyTcpClient(reactor.ipc.netty.tcp.TcpClient tcpClient,
ReactorNettyCodec<P> codec)
Constructor with an externally created
TcpClient instance whose
lifecycle is expected to be managed externally. |
| Modifier and Type | Method and Description |
|---|---|
ListenableFuture<java.lang.Void> |
connect(TcpConnectionHandler<P> handler)
Open a new connection.
|
ListenableFuture<java.lang.Void> |
connect(TcpConnectionHandler<P> handler,
ReconnectStrategy strategy)
Open a new connection and a strategy for reconnecting if the connection fails.
|
ListenableFuture<java.lang.Void> |
shutdown()
Shut down and close any open connections.
|
java.lang.String |
toString() |
public ReactorNettyTcpClient(java.lang.String host,
int port,
ReactorNettyCodec<P> codec)
host - the host to connect toport - the port to connect tocodec - the code to useStompReactorNettyCodecpublic ReactorNettyTcpClient(java.util.function.Consumer<reactor.ipc.netty.options.ClientOptions.Builder<?>> optionsConsumer,
ReactorNettyCodec<P> codec)
ClientOptions.Builder that can be used to
customize Reactor Netty client options.
Note: this constructor manages the lifecycle of the
TcpClient and its underlying resources. Please do not customize
any of the following options:
ChannelGroup,
LoopResources, and
PoolResources.
You may set the disablePool
option if you simply want to turn off pooling.
For full control over the initialization and lifecycle of the TcpClient,
see ReactorNettyTcpClient(TcpClient, ReactorNettyCodec).
optionsConsumer - consumer to customize client optionscodec - the code to useStompReactorNettyCodecpublic ReactorNettyTcpClient(reactor.ipc.netty.tcp.TcpClient tcpClient,
ReactorNettyCodec<P> codec)
TcpClient instance whose
lifecycle is expected to be managed externally.tcpClient - the TcpClient instance to usecodec - the code to useStompReactorNettyCodecpublic ListenableFuture<java.lang.Void> connect(TcpConnectionHandler<P> handler)
TcpOperationsconnect in interface TcpOperations<P>handler - a handler to manage the connectionpublic ListenableFuture<java.lang.Void> connect(TcpConnectionHandler<P> handler, ReconnectStrategy strategy)
TcpOperationsconnect in interface TcpOperations<P>handler - a handler to manage the connectionstrategy - a strategy for reconnectingpublic ListenableFuture<java.lang.Void> shutdown()
TcpOperationsshutdown in interface TcpOperations<P>public java.lang.String toString()
toString in class java.lang.Object