Grouped Flow
Represents a Flow of values that have a common key.
Note: A GroupedFlow will cache the items it is to emit until such time as it is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those GroupedFlows that do not concern you. Instead, you can signal to them that they may discard their buffers by applying an operator like take(0)
to them.
Properties
The key that identifies the group of items emitted by this GroupedFlow.
Functions
Buffers the source Flow values until the size hits the maximum bufferSize given.
Buffers a number of values from the source Flow by bufferSize then emits the buffer and clears it, and starts a new buffer each startBufferEvery values.
Catches exceptions in the flow completion and emits all the items provided by fallbackSupplier. If the fallback flow also throws an exception, the exception is not caught and is rethrown.
Catches exceptions in the flow completion and emits a single item, then completes normally.
Catches exceptions in the flow completion and emits a single item provided by itemSupplier, then completes normally.
This function is an alias to flattenFirst operator.
Transforms elements emitted by the original flow by applying transform, that returns another flow, and then merging and flattening these flows.
Flattens the given flow of flows into a single flow in a sequential manner, without interleaving nested flows. But unlike flattenConcat collecting nested flows performed concurrently with a given concurrency limit on the number of concurrently collected flows.
Groups the items emitted by the current Flow according to a specified criterion, and emits these grouped items as GroupedFlows.
Maps values in the Flow to successful results, and catches and wraps any exception into a failure result.
Groups pairs of consecutive emissions together and emits them as a pair.
Groups pairs of consecutive emissions together and emits the result of applying transform function to each pair.
Returns a Flow that repeats all values emitted by the original Flow at most count times. If count is zero or negative, the resulting Flow completes immediately without emitting any items (i.e. emptyFlow).
Returns a Flow that repeats all values emitted by the original Flow indefinitely, with a delay computed by delay function between each repetition.
Retries collection of the given flow when an exception occurs in the upstream flow and the predicate returns true. The predicate also receives an attempt
number as parameter, starting from zero on the initial call. When predicate returns true, the next retries will be delayed after a duration computed by DelayStrategy.nextDelay.
Retries collection of the given flow with exponential backoff delay strategy when an exception occurs in the upstream flow and the predicate returns true. When predicate returns true, the next retries will be delayed after a duration computed by DelayStrategy.ExponentialBackoffDelayStrategy.
Retries collection of the given flow with exponential backoff delay strategy when an exception occurs in the upstream flow and the predicate returns true. When predicate returns true, the next retries will be delayed after a duration computed by DelayStrategy.ExponentialBackoffDelayStrategy.
Select a sub-state from the State and emit it if it is different from the previous one.
Returns a Flow that emits a specified item before it begins to emit items emitted by the current Flow.
Returns a Flow that emits the specified items before it begins to emit items emitted by the current Flow.
Returns a Flow that emits a specified item before it begins to emit items emitted by the current Flow. itemFactory will be called on the collection for each new FlowCollector.
Returns a Flow that emits a value from the source Flow, then ignores subsequent source values for a duration determined by durationSelector, then repeats this process for the next source value.
Returns a Flow that emits a value from the source Flow, then ignores subsequent source values for timeMillis milliseconds, then repeats this process for the next source value.