@FunctionalInterface
public interface FlushStrategy
Modifier and Type | Interface and Description |
---|---|
static interface |
FlushStrategy.FlushSender
An abstraction for a
FlushStrategy to flush writes by calling FlushStrategy.FlushSender.flush() . |
static interface |
FlushStrategy.WriteEventsListener
A listener of write events from the connection on which the related
FlushStrategy is
applied . |
Modifier and Type | Method and Description |
---|---|
FlushStrategy.WriteEventsListener |
apply(FlushStrategy.FlushSender sender)
Every time a new write that requires custom flushes is initiated, this method is invoked.
|
default boolean |
shouldFlushOnUnwritable()
Returns
true if pending writes, if any, MUST be flushed when the connection is not writable. |
FlushStrategy.WriteEventsListener apply(FlushStrategy.FlushSender sender)
FlushStrategy.FlushSender
is used to signal
to the connection that writes should now be
flushed.sender
- FlushStrategy.FlushSender
to signal flushes to the connection.FlushStrategy.WriteEventsListener
that would listen to write events on the connection for which custom flushes
are required.default boolean shouldFlushOnUnwritable()
true
if pending writes, if any, MUST be flushed when the connection is not writable. This method is expected to be idempotent.
true
if pending writes, if any, MUST be flushed when the connection is not writable.