FlowRunOps
Attributes
Members list
Value members
Concrete methods
Ignores all elements emitted by the flow. Blocks until the flow completes.
Ignores all elements emitted by the flow. Blocks until the flow completes.
Attributes
Uses zero
as the current value and applies function f
on it and a value emitted by this flow. The returned value is used as the next current value and f
is applied again with the next value emitted by the flow. The operation is repeated until the flow emits all elements.
Uses zero
as the current value and applies function f
on it and a value emitted by this flow. The returned value is used as the next current value and f
is applied again with the next value emitted by the flow. The operation is repeated until the flow emits all elements.
Value parameters
- f
-
A binary function (a function that takes two arguments) that is applied to the current value and value emitted by the flow.
- zero
-
An initial value to be used as the first argument to function
f
call.
Attributes
- Returns
-
Combined value retrieved from running function
f
on all flow elements in a cumulative manner where result of the previous call is used as an input value to the next.
Invokes the given function for each emitted element. Blocks until the flow completes.
Invokes the given function for each emitted element. Blocks until the flow completes.
Attributes
Returns the last element emitted by this flow, or throws NoSuchElementException when the flow emits no elements (is empty).
Returns the last element emitted by this flow, or throws NoSuchElementException when the flow emits no elements (is empty).
Attributes
- Throws
-
NoSuchElementException
When this flow is empty.
Returns the last element emitted by this flow, wrapped in Some, or None when this source is empty.
Returns the last element emitted by this flow, wrapped in Some, or None when this source is empty.
Attributes
Passes each element emitted by this flow to the given sink. Blocks until the flow completes.
Passes each element emitted by this flow to the given sink. Blocks until the flow completes.
Errors are always propagated to the provided sink. Successful flow completion is propagated when propagateDone
is set to true
.
Fatal errors are rethrown.
Attributes
Applies function f
on the first and the following (if available) elements emitted by this flow. The returned value is used as the next current value and f
is applied again with the next value emitted by this source. The operation is repeated until this flow emits all elements. This is similar operation to fold but it uses the first emitted element as zero
.
Applies function f
on the first and the following (if available) elements emitted by this flow. The returned value is used as the next current value and f
is applied again with the next value emitted by this source. The operation is repeated until this flow emits all elements. This is similar operation to fold but it uses the first emitted element as zero
.
Value parameters
- f
-
A binary function (a function that takes two arguments) that is applied to the current and next values emitted by this flow.
Attributes
- Returns
-
Combined value retrieved from running function
f
on all flow elements in a cumulative manner where result of the previous call is used as an input value to the next. - Throws
-
NoSuchElementException
When this flow is empty.
Returns the list of up to n
last elements emitted by this flow. Less than n
elements is returned when this flow emits less elements than requested. List.empty is returned when takeLast
is called on an empty flow.
Returns the list of up to n
last elements emitted by this flow. Less than n
elements is returned when this flow emits less elements than requested. List.empty is returned when takeLast
is called on an empty flow.
Value parameters
- n
-
Number of elements to be taken from the end of this flow. It is expected that
n >= 0
.
Attributes
- Returns
-
A list of up to
n
last elements from this flow.
The flow is run in the background, and each emitted element is sent to a newly created channel, which is then returned as the result of this method.
The flow is run in the background, and each emitted element is sent to a newly created channel, which is then returned as the result of this method.
Must be run within a concurrency scope as a fork is created to run the flow. The size of the buffer is determined by the BufferCapacity that is in scope.
Attributes
Accumulates all elements emitted by this flow into a list. Blocks until the flow completes.
Accumulates all elements emitted by this flow into a list. Blocks until the flow completes.