P
- the type of payload for outbound messagespublic class ReactorNettyTcpConnection<P> extends Object implements TcpConnection<P>
TcpConnection
.Constructor and Description |
---|
ReactorNettyTcpConnection(reactor.netty.NettyInbound inbound,
reactor.netty.NettyOutbound outbound,
ReactorNettyCodec<P> codec,
reactor.core.publisher.Sinks.Empty<Void> completionSink) |
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.netty.NettyInbound inbound, reactor.netty.NettyOutbound outbound, ReactorNettyCodec<P> codec, reactor.core.publisher.Sinks.Empty<Void> completionSink)
public ListenableFuture<Void> send(Message<P> message)
TcpConnection
send
in interface TcpConnection<P>
message
- the messagepublic void onReadInactivity(Runnable runnable, long inactivityDuration)
TcpConnection
onReadInactivity
in interface TcpConnection<P>
runnable
- the task to invokeinactivityDuration
- the amount of inactive time in millisecondspublic void onWriteInactivity(Runnable runnable, long inactivityDuration)
TcpConnection
onWriteInactivity
in interface TcpConnection<P>
runnable
- the task to invokeinactivityDuration
- the amount of inactive time in millisecondspublic void close()
TcpConnection
close
in interface Closeable
close
in interface AutoCloseable
close
in interface TcpConnection<P>