To have some elements in my stream read from a cache, i try to build a Graph with the following semantics:
|---> Flow 1 (cache hit - just forward IN) IN ---> (condition) |---> OUT |---> Flow 2 (no cache hit - forward to underlying flow)
I could do that with
Partition, but my requirement is to have the total order to be stable, so I have no clue how to merge it back together without loosing the order (or adding an id to reorder?).
Proposal flatMapConcat & Source.single*
I could also do a flatMapConcat and with two different Source.single in it. The problem is that the underlying flow can never to a mapAsync or grouping as it gets always just one element from Source.single.
Do you have any ideas or suggestions to solve that?