Class DelegatingFlushStrategy
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.DelegatingFlushStrategy
-
- All Implemented Interfaces:
FlushStrategy
public class DelegatingFlushStrategy extends java.lang.Object implements FlushStrategy
AFlushStrategy
implementation 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.WriteEventsListener
apply(FlushStrategy.FlushSender sender)
Every time a new write that requires custom flushes is initiated, this method is invoked.protected FlushStrategy
delegate()
Returns the delegateFlushStrategy
used.boolean
shouldFlushOnUnwritable()
Returnstrue
if 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
-FlushStrategy
to delegate all calls.
-
-
Method Detail
-
apply
public FlushStrategy.WriteEventsListener apply(FlushStrategy.FlushSender sender)
Description copied from interface:FlushStrategy
Every time a new write that requires custom flushes is initiated, this method is invoked. PassedFlushStrategy.FlushSender
is used tosignal
to the connection that writes should now be flushed.- Specified by:
apply
in interfaceFlushStrategy
- Parameters:
sender
-FlushStrategy.FlushSender
to signal flushes to the connection.- Returns:
FlushStrategy.WriteEventsListener
that would listen to write events on the connection for which custom flushes are required.
-
shouldFlushOnUnwritable
public boolean shouldFlushOnUnwritable()
Description copied from interface:FlushStrategy
Returnstrue
if pending writes, if any, MUST be flushed when the connection is not writable.This method is expected to be idempotent.
- Specified by:
shouldFlushOnUnwritable
in interfaceFlushStrategy
- Returns:
true
if pending writes, if any, MUST be flushed when the connection is not writable.
-
delegate
protected FlushStrategy delegate()
Returns the delegateFlushStrategy
used.- Returns:
- The delegate
FlushStrategy
used.
-
-