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) UpdatesFlushStrategy
enclosed in thisFlushStrategyHolder
.
-
Constructor Details
-
FlushStrategyHolder
Creates new instance.- Parameters:
flushStrategy
- InitialFlushStrategy
to 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) UpdatesFlushStrategy
enclosed in thisFlushStrategyHolder
.- 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.
-