@FlowPreview fun <T> Flow<Flow<T>>.flattenMerge(
    concurrency: Int = DEFAULT_CONCURRENCY
): Flow<T>

Flattens the given flow of flows into a single flow with a concurrency limit on the number of concurrently collected flows.

If concurrency is more than 1, then inner flows are be collected by this operator concurrently. With concurrency == 1 this operator is identical to flattenConcat.

Operator fusion

Applications of flowOn, buffer, produceIn, and broadcastIn after this operator are fused with its concurrent merging so that only one properly configured channel is used for execution of merging logic.


concurrency - controls the number of in-flight flows, at most concurrency flows are collected at the same time. By default it is equal to DEFAULT_CONCURRENCY.