Defines a synchronous Consumer that builds synchronous subscribers.
A consumer that immediately cancels its upstream after subscription.
A simple consumer that consumes all elements of the stream and then signals its completion.
Creates a Consumer out of the given function.
Creates a Consumer out of the given function.
The function returns an Observer and takes as input:
Stop
from onNext
)is the input function with an injected Scheduler
,
Cancelable
, Callback
and that returns an Observer
A consumer that will produce a Notification of the first value
received (onNext
, onComplete
or onError
), after which the
streaming gets cancelled.
A consumer that will produce a Notification of the first value
received (onNext
, onComplete
or onError
), after which the
streaming gets cancelled.
onNext
event if it happens and the streaming will be stopped by Stop
.onNext
.onNext
happened.
Given a fold function and an initial state value, applies the fold function to every element of the stream and finally signaling the accumulated value.
Given a fold function and an initial state value, applies the fold function to every element of the stream and finally signaling the accumulated value.
is a lazy value that will be fed at first in the fold function as the initial state.
is the function that calculates a new state on each emitted value by the stream, for accumulating state
Given a fold function and an initial state value, applies the fold function to every element of the stream and finally signaling the accumulated value.
Given a fold function and an initial state value, applies the fold function to every element of the stream and finally signaling the accumulated value.
The given fold function returns a Task
that can execute an
asynchronous operation, with ordering of calls being guaranteed.
is a lazy value that will be fed at first in the fold function as the initial state.
is the function that calculates a new state on each
emitted value by the stream, for accumulating state,
returning a Task
capable of asynchronous execution.
Builds a consumer that will consume the stream, applying the given function to each element and then finally signaling its completion.
Builds a consumer that will consume the stream, applying the given function to each element and then finally signaling its completion.
is the function that will be called for each element
Builds a consumer that will consume the stream, applying the given function to each element and then finally signaling its completion.
Builds a consumer that will consume the stream, applying the given function to each element and then finally signaling its completion.
The given callback function returns a Task
that can execute an
asynchronous operation, with ordering of calls being guaranteed.
is the function that will be called for each element
Builds a consumer that will consume the stream, applying the given function to each element, in parallel, then finally signaling its completion.
Builds a consumer that will consume the stream, applying the given function to each element, in parallel, then finally signaling its completion.
is the maximum number of (logical) threads to use
is the function that will be called for each element
Builds a consumer that will consume the stream, applying the given function to each element, in parallel, then finally signaling its completion.
Builds a consumer that will consume the stream, applying the given function to each element, in parallel, then finally signaling its completion.
The given callback function returns a Task
that can execute an
asynchronous operation, with ordering of calls being guaranteed
per subscriber.
is the maximum number of (logical) threads to use
is the function that will be called for each element
Given a function taking a Scheduler
and returning an Observer,
builds a consumer from it.
Given a function taking a Scheduler
and returning an Observer,
builds a consumer from it.
You can use the Scheduler
as the execution context, for working
with Future
, for forcing asynchronous boundaries or for executing
tasks with a delay.
A consumer that will produce the first streamed value on
onNext
after which the streaming gets cancelled.
A consumer that will produce the first streamed value on
onNext
after which the streaming gets cancelled.
In case the stream is empty and so no onNext
happen before
onComplete
, then the a NoSuchElementException
will get
triggered.
A consumer that will produce the first streamed value on
onNext
after which the streaming gets cancelled.
A consumer that will produce the first streamed value on
onNext
after which the streaming gets cancelled.
In case the stream is empty and so no onNext
happen before
onComplete
, then the a NoSuchElementException
will get
triggered.
Creates a consumer that, when consuming the stream, will start multiple subscribers corresponding and distribute the load between them.
Creates a consumer that, when consuming the stream, will start multiple subscribers corresponding and distribute the load between them.
Once each subscriber emits a final result, this consumer will return a list of aggregated results.
Has the following rules:
onComplete
or onError
, all subscribers
that are still active will receive the eventonSuccess
callback of individual subscribers is
aggregated in a list buffer and once the aggregate contains
results from all subscribers, the load-balancing consumer
will emit the aggregateonError
callback triggered by individual subscribers will
signal that error upstream and cancel the streaming for
every other subscriberStop
in onNext
or canceling its assigned
cancelable), it gets excluded from the pool of active
subscribers, but the other active subscribers will still
receive notificationsStop
or by canceling their assignable cancelable reference),
then streaming stops as well In other words the Task
, created by applying this consumer to
an observable, will complete once all the subscribers emit a result
or as soon as an error happens.
is a list of consumers that will initialize the subscribers that will process events in parallel, with the parallelism factor being equal to the number of consumers specified in this list.
a list of aggregated results that were computed by all of the subscribers as their result
Creates a consumer that, when consuming the stream, will start multiple subscribers corresponding and distribute the load between them.
Creates a consumer that, when consuming the stream, will start multiple subscribers corresponding and distribute the load between them.
Once each subscriber emits a final result, this consumer will return a list of aggregated results.
Has the following rules:
onComplete
or onError
, all subscribers
that are still active will receive the eventonSuccess
callback of individual subscribers is
aggregated in a list buffer and once the aggregate contains
results from all subscribers, the load-balancing consumer
will emit the aggregateonError
callback triggered by individual subscribers will
signal that error upstream and cancel the streaming for
every other subscriberStop
in onNext
or canceling its assigned
cancelable), it gets excluded from the pool of active
subscribers, but the other active subscribers will still
receive notificationsStop
or by canceling their assignable cancelable reference),
then streaming stops as well In other words the Task
, created by applying this consumer to
an observable, will complete once all the subscribers emit a result
or as soon as an error happens.
is the number of subscribers that will get initialized to process incoming events in parallel.
is the subscriber factory that will initialize all needed subscribers, in number equal to the specified parallelism and thus that will be fed in parallel
a list of aggregated results that were computed by all of the subscribers as their result
A consumer that triggers an error and immediately cancels its upstream after subscription.
The companion object of Consumer, defines consumer builders.