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 specializedConnectionContext
for netty based transports.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
NettyConnectionContext.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 FlushStrategy
defaultFlushStrategy()
Returns theFlushStrategy
used by default for thisNettyConnectionContext
.io.netty.channel.Channel
nettyChannel()
Return the NettyChannel
backing this connection.Completable
onClosing()
Returns aCompletable
that 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.Cancellable
updateFlushStrategy(NettyConnectionContext.FlushStrategyProvider strategyProvider)
UpdatesFlushStrategy
associated 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)
UpdatesFlushStrategy
associated with this connection. UpdatedFlushStrategy
will be used in any subsequent writes on this connection.- Parameters:
strategyProvider
-NettyConnectionContext.FlushStrategyProvider
to 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
Cancellable
that will cancel this update.
-
defaultFlushStrategy
FlushStrategy defaultFlushStrategy()
Returns theFlushStrategy
used by default for thisNettyConnectionContext
.- Returns:
- The
FlushStrategy
used 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 aCompletable
that notifies when the connection has begun its closing sequence.- Returns:
- a
Completable
that notifies when the connection has begun its closing sequence. A configuredCloseHandler
will determine whether more reads or writes will be allowed on thisNettyConnectionContext
.
-
nettyChannel
io.netty.channel.Channel nettyChannel()
Return the NettyChannel
backing this connection.- Returns:
- the Netty
Channel
backing this connection.
-
-