Class FlushStrategyHolder
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.FlushStrategyHolder
-
public final class FlushStrategyHolder extends java.lang.ObjectA utility class to hold aFlushStrategyand allow it to be updated atomically usingupdateFlushStrategy(NettyConnectionContext.FlushStrategyProvider).
-
-
Constructor Summary
Constructors Constructor Description FlushStrategyHolder(FlushStrategy flushStrategy)Creates new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlushStrategycurrentStrategy()Returns the current value of the enclosedFlushStrategy.CancellableupdateFlushStrategy(NettyConnectionContext.FlushStrategyProvider strategyProvider)UpdatesFlushStrategyenclosed in thisFlushStrategyHolder.
-
-
-
Constructor Detail
-
FlushStrategyHolder
public FlushStrategyHolder(FlushStrategy flushStrategy)
Creates new instance.- Parameters:
flushStrategy- InitialFlushStrategyto use.
-
-
Method Detail
-
currentStrategy
public FlushStrategy 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.
-
-