Interface NettyConnectionContext
-
- All Superinterfaces:
AsyncCloseable,ConnectionContext,ConnectionInfo,ListenableAsyncCloseable
- All Known Subinterfaces:
NettyConnection<Read,Write>
- All Known Implementing Classes:
DefaultNettyConnection
public interface NettyConnectionContext extends ConnectionContext
A specializedConnectionContextfor netty based transports.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceNettyConnectionContext.FlushStrategyProvider-
Nested classes/interfaces inherited from interface io.servicetalk.transport.api.ConnectionInfo
ConnectionInfo.Protocol
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FlushStrategydefaultFlushStrategy()Returns theFlushStrategyused by default for thisNettyConnectionContext.io.netty.channel.ChannelnettyChannel()Return the NettyChannelbacking this connection.CompletableonClosing()Returns aCompletablethat notifies when the connection has begun its closing sequence.Single<java.lang.Throwable>transportError()Returns aSingle<Throwable> that may terminate with an error, if an error is observed at the transport.CancellableupdateFlushStrategy(NettyConnectionContext.FlushStrategyProvider strategyProvider)UpdatesFlushStrategyassociated with this connection.-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
-
Methods inherited from interface io.servicetalk.transport.api.ConnectionInfo
executionContext, localAddress, protocol, remoteAddress, socketOption, sslSession
-
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose
-
-
-
-
Method Detail
-
updateFlushStrategy
Cancellable updateFlushStrategy(NettyConnectionContext.FlushStrategyProvider strategyProvider)
UpdatesFlushStrategyassociated with this connection. UpdatedFlushStrategywill be used in any subsequent writes on this connection.- Parameters:
strategyProvider-NettyConnectionContext.FlushStrategyProviderto provide a newFlushStrategy.NettyConnectionContext.FlushStrategyProvider.computeFlushStrategy(FlushStrategy, boolean)MAY be invoked multiple times for a single call to this method and is expected to be idempotent.- Returns:
- A
Cancellablethat will cancel this update.
-
defaultFlushStrategy
FlushStrategy defaultFlushStrategy()
Returns theFlushStrategyused by default for thisNettyConnectionContext.- Returns:
- The
FlushStrategyused by default for thisNettyConnectionContext.
-
transportError
Single<java.lang.Throwable> transportError()
Returns aSingle<Throwable> that may terminate with an error, if an error is observed at the transport.- Returns:
- a
Single<Throwable> that may terminate with an error, if an error is observed at the transport.
-
onClosing
Completable onClosing()
Returns aCompletablethat notifies when the connection has begun its closing sequence.- Returns:
- a
Completablethat notifies when the connection has begun its closing sequence. A configuredCloseHandlerwill determine whether more reads or writes will be allowed on thisNettyConnectionContext.
-
nettyChannel
io.netty.channel.Channel nettyChannel()
Return the NettyChannelbacking this connection.- Returns:
- the Netty
Channelbacking this connection.
-
-