An equivalent of Single.merge, which runs each Single sequentially

The Single.merge documentation says:

Merges an Iterable sequence of SingleSource instances into a single Flowable sequence, running all SingleSources at once.

Is there a similar operator which creates a Flowable, which does not runs all SingleSources at once but, instead, runs them sequentially - each one after the previous one completes?

Upvotes: 1

Views: 34

Answers (1)

I've found a solution:

val singles: List<Single<String>> = // the list of Single
Flowable
    .fromIterable(singles)
    .flatMapSingle({ it }, false, /* maxConcurrency */ 1)

Upvotes: 1

Related Questions