public class ReactorNettyTcpConnection<P> extends java.lang.Object implements TcpConnection<P>
TcpConnection.| Constructor and Description |
|---|
ReactorNettyTcpConnection(reactor.ipc.netty.NettyInbound inbound,
reactor.ipc.netty.NettyOutbound outbound,
ReactorNettyCodec<P> codec,
reactor.core.publisher.DirectProcessor<java.lang.Void> closeProcessor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
void |
onReadInactivity(java.lang.Runnable runnable,
long inactivityDuration)
Register a task to invoke after a period of read inactivity.
|
void |
onWriteInactivity(java.lang.Runnable runnable,
long inactivityDuration)
Register a task to invoke after a period of write inactivity.
|
ListenableFuture<java.lang.Void> |
send(Message<P> message)
Send the given message.
|
public ReactorNettyTcpConnection(reactor.ipc.netty.NettyInbound inbound,
reactor.ipc.netty.NettyOutbound outbound,
ReactorNettyCodec<P> codec,
reactor.core.publisher.DirectProcessor<java.lang.Void> closeProcessor)
public ListenableFuture<java.lang.Void> send(Message<P> message)
TcpConnectionsend in interface TcpConnection<P>message - the messagepublic void onReadInactivity(java.lang.Runnable runnable,
long inactivityDuration)
TcpConnectiononReadInactivity in interface TcpConnection<P>runnable - the task to invokeinactivityDuration - the amount of inactive time in millisecondspublic void onWriteInactivity(java.lang.Runnable runnable,
long inactivityDuration)
TcpConnectiononWriteInactivity in interface TcpConnection<P>runnable - the task to invokeinactivityDuration - the amount of inactive time in millisecondspublic void close()
TcpConnectionclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface TcpConnection<P>