Class DelegatingFlushStrategy
java.lang.Object
io.servicetalk.transport.netty.internal.DelegatingFlushStrategy
- All Implemented Interfaces:
FlushStrategy
A
FlushStrategy
implementation that delegates all calls to another FlushStrategy
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.servicetalk.transport.netty.internal.FlushStrategy
FlushStrategy.FlushSender, FlushStrategy.WriteEventsListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(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
Returnstrue
if pending writes, if any, MUST be flushed when the connection is not writable.
-
Constructor Details
-
DelegatingFlushStrategy
Create a new instance.- Parameters:
delegate
-FlushStrategy
to delegate all calls.
-
-
Method Details
-
apply
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
Returns the delegateFlushStrategy
used.- Returns:
- The delegate
FlushStrategy
used.
-