I must create a stream of execution, in which a series of Observables must be executed, some being in parallel and others awaiting the execution of the ones that are in parallel to be executed. These Observables manipulate data that is passed to the others. For example, Observable 2 handles data that must be consumed by Observable 4 later.
In summary, the flow should be something like:
Time ------------------------->
- -Observable 1 (Get data on database. Parallel with 2)
- -Observable 2 (manipulate existing ArrayList to future use)
- -----Observable 3 (Get data on another database. After 1 AND 2 executions, because using data from both)
- ---------Observable 4 (manipulate result of 3, using list result to create another list. After 3)
- -------------Observable 5 (with result of 4, i will insert log data on database. After 4 and Parallel with 6)
- -------------Observable 6 (create a list of result to return on actual method)
Some observables in parallel and others waiting for the finalization to execute, and those that wait, can be one, or more of one, to be executed also in parallel.
I have been trying in various ways, creating lists of Observables and running in .zip (with .observeOn (Schedulers.computation ()) in each observable), I have also tried with .zipWith. But without success.