public class ReactorNettyTcpConnection<P> extends 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<Void> closeProcessor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
void |
onReadInactivity(Runnable runnable,
long inactivityDuration)
Register a task to invoke after a period of read inactivity.
|
void |
onWriteInactivity(Runnable runnable,
long inactivityDuration)
Register a task to invoke after a period of write inactivity.
|
ListenableFuture<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<Void> closeProcessor)
public ListenableFuture<Void> send(Message<P> message)
TcpConnectionsend in interface TcpConnection<P>message - the messagepublic void onReadInactivity(Runnable runnable, long inactivityDuration)
TcpConnectiononReadInactivity in interface TcpConnection<P>runnable - the task to invokeinactivityDuration - the amount of inactive time in millisecondspublic void onWriteInactivity(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 Closeableclose in interface AutoCloseableclose in interface TcpConnection<P>