interface ParallelFlow<out T>
Base interface for parallel stages in an operator
abstract val parallelism: Int |
abstract suspend fun collect(vararg collectors: FlowCollector<T>): Unit |
fun <T, R> ParallelFlow<T>.concatMap(mapper: suspend (T) -> Flow<R>): ParallelFlow<R>
Maps the upstream value on each rail onto a Flow and emits their values in order on the same rail. |
|
fun <T> ParallelFlow<T>.filter(predicate: suspend (T) -> Boolean): ParallelFlow<T>
Filters the values of the upstream in parallel. |
|
fun <T, R> ParallelFlow<T>.map(mapper: suspend (T) -> R): ParallelFlow<R>
Maps the values of the upstream in parallel. |
|
fun <T, R> ParallelFlow<T>.reduce(seed: suspend () -> R, combine: suspend (R, T) -> R): ParallelFlow<R>
Reduces the source items into a single value on each rail and emits those. fun <T> ParallelFlow<T>.reduce(combine: suspend (T, T) -> T): Flow<T>
Reduce the values within the parallel rails and then reduce the rails to a single result value. |
|
fun <T> ParallelFlow<T>.sequential(): Flow<T>
Consumes the parallel upstream and turns it into a sequential flow again. |
|
fun <T, R> ParallelFlow<T>.transform(callback: suspend FlowCollector<R>.(T) -> Unit): ParallelFlow<R>
Transform each upstream item into zero or more emits for the downstream in parallel. |