Class DelegatingFlushStrategy
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.DelegatingFlushStrategy
-
- All Implemented Interfaces:
FlushStrategy
public class DelegatingFlushStrategy extends java.lang.Object implements FlushStrategy
AFlushStrategyimplementation that delegates all calls to anotherFlushStrategy.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.servicetalk.transport.netty.internal.FlushStrategy
FlushStrategy.FlushSender, FlushStrategy.WriteEventsListener
-
-
Constructor Summary
Constructors Constructor Description DelegatingFlushStrategy(FlushStrategy delegate)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlushStrategy.WriteEventsListenerapply(FlushStrategy.FlushSender sender)Every time a new write that requires custom flushes is initiated, this method is invoked.protected FlushStrategydelegate()Returns the delegateFlushStrategyused.booleanshouldFlushOnUnwritable()Returnstrueif pending writes, if any, MUST be flushed when the connection is not writable.
-
-
-
Constructor Detail
-
DelegatingFlushStrategy
public DelegatingFlushStrategy(FlushStrategy delegate)
Create a new instance.- Parameters:
delegate-FlushStrategyto delegate all calls.
-
-
Method Detail
-
apply
public FlushStrategy.WriteEventsListener apply(FlushStrategy.FlushSender sender)
Description copied from interface:FlushStrategyEvery time a new write that requires custom flushes is initiated, this method is invoked. PassedFlushStrategy.FlushSenderis used tosignalto the connection that writes should now be flushed.- Specified by:
applyin interfaceFlushStrategy- Parameters:
sender-FlushStrategy.FlushSenderto signal flushes to the connection.- Returns:
FlushStrategy.WriteEventsListenerthat would listen to write events on the connection for which custom flushes are required.
-
shouldFlushOnUnwritable
public boolean shouldFlushOnUnwritable()
Description copied from interface:FlushStrategyReturnstrueif pending writes, if any, MUST be flushed when the connection is not writable.This method is expected to be idempotent.
- Specified by:
shouldFlushOnUnwritablein interfaceFlushStrategy- Returns:
trueif pending writes, if any, MUST be flushed when the connection is not writable.
-
delegate
protected FlushStrategy delegate()
Returns the delegateFlushStrategyused.- Returns:
- The delegate
FlushStrategyused.
-
-