I did an RxJava2 experiment consisting of the following steps:
- Create an Observable from a ListA of Objects.
- Use flatMapSingle() to map each item emitted by the Observable, to a SingleSource. Inside flatMapSingle(), an asychronous operation is executed for each item emitted by the Observable.
- Collected all items in a ListB, with Observable.toList()
Result: ListB has its items in different order than ListA due to the asynchronous operation.
So, it seems that flatMapSingle() works like flatMap() in the sense that it uses the merge operator and does not guarantee that the order of the elements will be preserved.
Is my conclusion correct? Documentation did not cover me and discussions about this behavior are nonexistent.