FlowCompanionOps
Attributes
Members list
Value members
Concrete methods
Creates a flow which concatenates the given flows
in order. First elements from the first flow are emitted, then from the second etc. If any of the flows completes with an error, it is propagated.
Creates a flow which concatenates the given flows
in order. First elements from the first flow are emitted, then from the second etc. If any of the flows completes with an error, it is propagated.
Attributes
Creates an empty flow, which emits no elements and completes immediately.
Creates an empty flow, which emits no elements and completes immediately.
Attributes
Creates a flow that fails immediately with the given java.lang.Throwable
Creates a flow that fails immediately with the given java.lang.Throwable
Value parameters
- t
-
The java.lang.Throwable to fail with
Attributes
Creates a flow from the given fork. The flow will emit up to one element, or complete by throwing an exception if the fork fails.
Creates a flow from the given fork. The flow will emit up to one element, or complete by throwing an exception if the fork fails.
Attributes
Creates a flow that emits a single element when from
completes, or throws an exception when from
fails.
Creates a flow that emits a single element when from
completes, or throws an exception when from
fails.
Attributes
Creates a flow that emits all elements from the given future Source when from
completes.
Creates a flow that emits all elements from the given future Source when from
completes.
Attributes
Creates a flow from the given iterable
. Each element of the iterable is emitted in order.
Creates a flow from the given iterable
. Each element of the iterable is emitted in order.
Attributes
Creates a flow from the given (lazily evaluated) iterator
. Each element of the iterator is emitted in order.
Creates a flow from the given (lazily evaluated) iterator
. Each element of the iterator is emitted in order.
Attributes
Creates a flow using the given source
. An element is emitted for each value received from the source. If the source is completed with an error, is it propagated by throwing.
Creates a flow using the given source
. An element is emitted for each value received from the source. If the source is completed with an error, is it propagated by throwing.
Attributes
Creates a flow from the given values. Each value is emitted in order.
Creates a flow from the given values. Each value is emitted in order.
Attributes
Sends a given number of elements (determined byc segmentSize
) from each flow in flows
to the returned flow and repeats. The order of elements in all flows is preserved.
Sends a given number of elements (determined byc segmentSize
) from each flow in flows
to the returned flow and repeats. The order of elements in all flows is preserved.
If any of the flows is done before the others, the behavior depends on the eagerCancel
flag. When set to true
, the returned flow is completed immediately, otherwise the interleaving continues with the remaining non-completed flows. Once all but one flows are complete, the elements of the remaining non-complete flow are emitted by the returned flow.
The provided flows are run concurrently and asynchronously.
Value parameters
- eagerComplete
-
If
true
, the returned flow is completed as soon as any of the flows completes. Iffalse
, the interleaving continues with the remaining non-completed flows. - flows
-
The flows whose elements will be interleaved.
- segmentSize
-
The number of elements sent from each flow before switching to the next one. Default is 1.
Attributes
Creates a flow which emits elements starting with zero
, and then applying f
to the previous element to get the next one.
Creates a flow which emits elements starting with zero
, and then applying f
to the previous element to get the next one.
Attributes
Creates a flow which emits a range of numbers, from from
, to to
(inclusive), stepped by step
.
Creates a flow which emits a range of numbers, from from
, to to
(inclusive), stepped by step
.
Attributes
Creates a flow, which emits the given element
repeatedly.
Creates a flow, which emits the given element
repeatedly.
Attributes
Creates a flow, which emits the result of evaluating f
repeatedly. As the parameter is passed by-name, the evaluation is deferred until the element is emitted, and happens multiple times.
Creates a flow, which emits the result of evaluating f
repeatedly. As the parameter is passed by-name, the evaluation is deferred until the element is emitted, and happens multiple times.
Value parameters
- f
-
The code block, computing the element to emit.
Attributes
Creates a flow, which emits the value contained in the result of evaluating f
repeatedly. When the evaluation of f
returns a None
, the flow is completed as "done", and no more values are evaluated or emitted.
Creates a flow, which emits the value contained in the result of evaluating f
repeatedly. When the evaluation of f
returns a None
, the flow is completed as "done", and no more values are evaluated or emitted.
As the f
parameter is passed by-name, the evaluation is deferred until the element is emitted, and happens multiple times.
Value parameters
- f
-
The code block, computing the optional element to emit.
Attributes
Creates a flow which emits the given value
repeatedly, at least interval apart between each two elements. The first value is emitted immediately.
Creates a flow which emits the given value
repeatedly, at least interval apart between each two elements. The first value is emitted immediately.
The interval is measured between subsequent emissions. Hence, if the following transformation pipeline is slow, the next emission can occur immediately after the previous one is fully processed (if processing took more than the inter-emission interval duration). However, ticks do not accumulate; for example, if processing is slow enough that multiple intervals pass between send invocations, only one tick will be sent.
Value parameters
- interval
-
The temporal spacing between subsequent ticks.
- value
-
The element to emitted on every tick.
Attributes
Create a flow which sleeps for the given timeout
and then completes as done.
Create a flow which sleeps for the given timeout
and then completes as done.
Attributes
Creates a flow which emits the first element of tuples returned by repeated applications of f
. The initial
state is used for the first application, and then the state is updated with the second element of the tuple. Emission stops when f
returns None
, otherwise it continues indefinitely.
Creates a flow which emits the first element of tuples returned by repeated applications of f
. The initial
state is used for the first application, and then the state is updated with the second element of the tuple. Emission stops when f
returns None
, otherwise it continues indefinitely.
Attributes
Creates a flow, which when run, provides a FlowEmit instance to the given withEmit
function. Elements can be emitted to be processed by downstream stages by calling FlowEmit.apply.
Creates a flow, which when run, provides a FlowEmit instance to the given withEmit
function. Elements can be emitted to be processed by downstream stages by calling FlowEmit.apply.
The FlowEmit
instance provided to the withEmit
callback should only be used on the calling thread. That is, FlowEmit
is thread-unsafe. Moreover, the instance should not be stored or captured in closures, which outlive the invocation of withEmit
.