Class FlushStrategyHolder
java.lang.Object
io.servicetalk.transport.netty.internal.FlushStrategyHolder
A utility class to hold a
FlushStrategy and allow it to be updated atomically using
updateFlushStrategy(NettyConnectionContext.FlushStrategyProvider).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current value of the enclosedFlushStrategy.updateFlushStrategy(NettyConnectionContext.FlushStrategyProvider strategyProvider) UpdatesFlushStrategyenclosed in thisFlushStrategyHolder.
-
Constructor Details
-
FlushStrategyHolder
Creates new instance.- Parameters:
flushStrategy- InitialFlushStrategyto use.
-
-
Method Details
-
currentStrategy
Returns the current value of the enclosedFlushStrategy.- Returns:
- Current value of the enclosed
FlushStrategy.
-
updateFlushStrategy
public Cancellable updateFlushStrategy(NettyConnectionContext.FlushStrategyProvider strategyProvider) UpdatesFlushStrategyenclosed in thisFlushStrategyHolder.- 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.
-