Class ParallelReduce<T,R>
- java.lang.Object
-
- io.reactivex.rxjava3.parallel.ParallelFlowable<R>
-
- io.reactivex.rxjava3.internal.operators.parallel.ParallelReduce<T,R>
-
- Type Parameters:
T
- the input value typeR
- the result value type
public final class ParallelReduce<T,R> extends ParallelFlowable<R>
Reduce the sequence of values in each 'rail' to a single value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ParallelReduce.ParallelReduceSubscriber<T,R>
-
Field Summary
Fields Modifier and Type Field Description (package private) Supplier<R>
initialSupplier
(package private) BiFunction<R,? super T,R>
reducer
(package private) ParallelFlowable<? extends T>
source
-
Constructor Summary
Constructors Constructor Description ParallelReduce(ParallelFlowable<? extends T> source, Supplier<R> initialSupplier, BiFunction<R,? super T,R> reducer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
parallelism()
Returns the number of expected parallelSubscriber
s.(package private) void
reportError(org.reactivestreams.Subscriber<?>[] subscribers, java.lang.Throwable ex)
void
subscribe(org.reactivestreams.Subscriber<? super R>[] subscribers)
Subscribes an array ofSubscriber
s to thisParallelFlowable
and triggers the execution chain for all 'rails'.-
Methods inherited from class io.reactivex.rxjava3.parallel.ParallelFlowable
collect, collect, compose, concatMap, concatMap, concatMapDelayError, concatMapDelayError, doAfterNext, doAfterTerminated, doOnCancel, doOnComplete, doOnError, doOnNext, doOnNext, doOnNext, doOnRequest, doOnSubscribe, filter, filter, filter, flatMap, flatMap, flatMap, flatMap, flatMapIterable, flatMapIterable, flatMapStream, flatMapStream, from, from, from, fromArray, map, map, map, mapOptional, mapOptional, mapOptional, reduce, reduce, runOn, runOn, sequential, sequential, sequentialDelayError, sequentialDelayError, sorted, sorted, to, toSortedList, toSortedList, validate
-
-
-
-
Field Detail
-
source
final ParallelFlowable<? extends T> source
-
reducer
final BiFunction<R,? super T,R> reducer
-
-
Constructor Detail
-
ParallelReduce
public ParallelReduce(ParallelFlowable<? extends T> source, Supplier<R> initialSupplier, BiFunction<R,? super T,R> reducer)
-
-
Method Detail
-
subscribe
public void subscribe(org.reactivestreams.Subscriber<? super R>[] subscribers)
Description copied from class:ParallelFlowable
Subscribes an array ofSubscriber
s to thisParallelFlowable
and triggers the execution chain for all 'rails'.- Backpressure:
- The backpressure behavior/expectation is determined by the supplied
Subscriber
. - Scheduler:
subscribe
does not operate by default on a particularScheduler
.
- Specified by:
subscribe
in classParallelFlowable<R>
- Parameters:
subscribers
- the subscribers array to run in parallel, the number of items must be equal to the parallelism level of thisParallelFlowable
- See Also:
ParallelFlowable.parallelism()
-
reportError
void reportError(org.reactivestreams.Subscriber<?>[] subscribers, java.lang.Throwable ex)
-
parallelism
public int parallelism()
Description copied from class:ParallelFlowable
Returns the number of expected parallelSubscriber
s.- Specified by:
parallelism
in classParallelFlowable<R>
- Returns:
- the number of expected parallel
Subscriber
s
-
-