Interface TcpOperations<P>
- Type Parameters:
P
- the type of payload for inbound and outbound messages
- All Known Implementing Classes:
ReactorNetty2TcpClient
,ReactorNettyTcpClient
public interface TcpOperations<P>
A contract for establishing TCP connections.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptiondefault ListenableFuture<Void>
connect
(TcpConnectionHandler<P> connectionHandler) Deprecated, for removal: This API element is subject to removal in a future version.default ListenableFuture<Void>
connect
(TcpConnectionHandler<P> connectionHandler, ReconnectStrategy reconnectStrategy) Deprecated, for removal: This API element is subject to removal in a future version.as of 6.0, in favor ofconnectAsync(TcpConnectionHandler, ReconnectStrategy)
connectAsync
(TcpConnectionHandler<P> connectionHandler) Open a new connection.connectAsync
(TcpConnectionHandler<P> connectionHandler, ReconnectStrategy reconnectStrategy) Open a new connection and a strategy for reconnecting if the connection fails.default ListenableFuture<Void>
shutdown()
Deprecated, for removal: This API element is subject to removal in a future version.as of 6.0, in favor ofshutdownAsync()
Shut down and close any open connections.
-
Method Details
-
connect
@Deprecated(since="6.0", forRemoval=true) default ListenableFuture<Void> connect(TcpConnectionHandler<P> connectionHandler) Deprecated, for removal: This API element is subject to removal in a future version.as of 6.0, in favor ofconnectAsync(TcpConnectionHandler)
Open a new connection.- Parameters:
connectionHandler
- a handler to manage the connection- Returns:
- a ListenableFuture that can be used to determine when and if the connection is successfully established
-
connectAsync
Open a new connection.- Parameters:
connectionHandler
- a handler to manage the connection- Returns:
- a CompletableFuture that can be used to determine when and if the connection is successfully established
- Since:
- 6.0
-
connect
@Deprecated(since="6.0", forRemoval=true) default ListenableFuture<Void> connect(TcpConnectionHandler<P> connectionHandler, ReconnectStrategy reconnectStrategy) Deprecated, for removal: This API element is subject to removal in a future version.as of 6.0, in favor ofconnectAsync(TcpConnectionHandler, ReconnectStrategy)
Open a new connection and a strategy for reconnecting if the connection fails.- Parameters:
connectionHandler
- a handler to manage the connectionreconnectStrategy
- a strategy for reconnecting- Returns:
- a ListenableFuture that can be used to determine when and if the initial connection is successfully established
-
connectAsync
CompletableFuture<Void> connectAsync(TcpConnectionHandler<P> connectionHandler, ReconnectStrategy reconnectStrategy) Open a new connection and a strategy for reconnecting if the connection fails.- Parameters:
connectionHandler
- a handler to manage the connectionreconnectStrategy
- a strategy for reconnecting- Returns:
- a CompletableFuture that can be used to determine when and if the initial connection is successfully established
- Since:
- 6.0
-
shutdown
Deprecated, for removal: This API element is subject to removal in a future version.as of 6.0, in favor ofshutdownAsync()
Shut down and close any open connections.- Returns:
- a ListenableFuture that can be used to determine when and if the connection is successfully closed
-
shutdownAsync
CompletableFuture<Void> shutdownAsync()Shut down and close any open connections.- Returns:
- a CompletableFuture that can be used to determine when and if the connection is successfully closed
- Since:
- 6.0
-
connectAsync(TcpConnectionHandler)