public final class FlushStrategies
extends java.lang.Object
FlushStrategy.| Modifier and Type | Method and Description |
|---|---|
static FlushStrategy |
batchFlush(int batchSize,
Publisher<?> durationBoundaries)
Creates a
FlushStrategy that will flush writes in a batch of
batchSize or on expiration of a batch duration i.e. |
static FlushStrategy |
defaultFlushStrategy()
Creates a default
FlushStrategy. |
static FlushStrategy |
flushOnEach()
Creates a
FlushStrategy that will flush writes on each call to
the returned FlushStrategy.WriteEventsListener.itemWritten(Object) from FlushStrategy.apply(FlushSender). |
static FlushStrategy |
flushOnEnd()
Creates a
FlushStrategy that will flush writes when
FlushStrategy.WriteEventsListener.writeTerminated() is called on the FlushStrategy.WriteEventsListener returned from
FlushStrategy.apply(FlushSender). |
static FlushStrategy |
flushWith(Publisher<?> flushBoundaries)
|
public static FlushStrategy defaultFlushStrategy()
FlushStrategy.FlushStrategy.public static FlushStrategy flushOnEach()
FlushStrategy that will flush writes on each call to
the returned FlushStrategy.WriteEventsListener.itemWritten(Object) from FlushStrategy.apply(FlushSender).FlushStrategy that will flush writes on each call to the returned
FlushStrategy.WriteEventsListener.itemWritten(Object) from FlushStrategy.apply(FlushSender).public static FlushStrategy batchFlush(int batchSize, Publisher<?> durationBoundaries)
FlushStrategy that will flush writes in a batch of
batchSize or on expiration of a batch duration i.e. when an item is emitted from
durationBoundaries.batchSize - Number of items in each batch which needs flushing.durationBoundaries - Batch durations. Every time an item is emitted on this Publisher, the returned
FlushStrategy will flush writes.FlushStrategy that will flush writes in a batch of
batchSize or on expiration of a batch duration i.e. when an item is emitted from
durationBoundaries.public static FlushStrategy flushWith(Publisher<?> flushBoundaries)
flushBoundaries - Flush boundaries. Every time an item is emitted on this Publisher, the returned
FlushStrategy will flush writes.FlushStrategy that will flush writes when an item is emitted from
flushBoundaries.public static FlushStrategy flushOnEnd()
FlushStrategy that will flush writes when
FlushStrategy.WriteEventsListener.writeTerminated() is called on the FlushStrategy.WriteEventsListener returned from
FlushStrategy.apply(FlushSender).FlushStrategy that will flush writes when either of
FlushStrategy.WriteEventsListener.writeTerminated() is called on the FlushStrategy.WriteEventsListener returned from
FlushStrategy.apply(FlushSender).