Why doesn't ParallelFlowable.collect(Collector)
return a Single
?
#7836
Labels
ParallelFlowable.collect(Collector)
return a Single
?
#7836
From my understanding,
ParallelFlowable.collect(Collector)
uses the collector to accumulate values from each parallel rail and then combines each rail's final state into a single output value. It emits that value through a returnedFlowable<R>
, which will only ever emit one value. Why doesn't this API return aSingle<T>
? Does the choice to not return aSingle
imply that if I as a caller immediately convert the returned flowable to a single usingsingleOrError()
, I might hit some problem? Also, the documentation seems off. It claims this:But why would each rail need its own combiner? The
Collector
interface is designed for parallel collecting to use just the accumulator in each thread, with the combiner only used to combine final results from multiple threads. Looking at the implementation, I see that this is howParallelCollector
works too: each rail only uses the accumulator, and the final parent flow only uses the combiner.The text was updated successfully, but these errors were encountered: