Package-level declarations
Types
Interface that computes the delay between retries.
Marks declarations in the FlowExt
that are delicate — they have limited use-case and shall be used with care in general code. Any use of a delicate declaration has to be carefully reviewed to make sure it is properly used and does not create problems like memory and resource leaks. Carefully read documentation of any declaration marked as DelicateFlowExtApi
.
Marks FlowExt
-related API as a feature preview.
Represents a Flow of values that have a common key.
Define leading and trailing behavior.
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.
Returns the encapsulated error if this Event is an Event.Error, otherwise returns null
.
Returns the encapsulated error if this Event is an Event.Error. Otherwise, throws a NoSuchElementException.
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.
Creates a cold flow that produces a single value from the given function. It calls function for each new FlowCollector.
Creates a cold flow that produces a single value from the given function. It calls function for each new FlowCollector.
Groups the items emitted by the current Flow according to a specified criterion, and emits these grouped items as GroupedFlows.
Returns a Flow that emits a 0L after the initialDelayMillis and ever-increasing numbers after each periodMillis of time thereafter.
Returns a Flow that emits a 0L after the initialDelay and ever-increasing numbers after each period of time thereafter.
Maps values in the Flow to successful results, and catches and wraps any exception into a failure result.
Returns a NeverFlow that never emits any values to the FlowCollector and never completes.
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.
Returns the encapsulated value if this Event is a Event.Value, otherwise returns defaultValue.
Returns the encapsulated value if this Event is a Event.Value, otherwise returns the result of calling defaultValue function.
Returns the encapsulated value if this Event is a Event.Value, otherwise returns null
.
Returns the encapsulated value if this Event is a Event.Value. If this is Event.Error, throws the encapsulated error. Otherwise, throws a NoSuchElementException.