These are chat archives for ReactiveX/RxJava
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
Hi, I'm trying to figure out if my usage of RxJava (with Spring) is a) actually an use-case for reactive and b) if I'm doing it right, because I have to jump through some (perceived?) hoops to get to the result I want, so I'm doubting that I'm doing it right.
I have a request R, that is passed through some "fixers" F(R) that require a Single/Mono and return a Single/Mono of the same type, then this Mono/Single F(R) is passed into "validators" V(F(R)) that require a Single/Mono of type R and return a Single/Mono of type bool; when all V(F(R)) are returned and true I want to send them to some "performers" P(F(R)) that require the Single/Mono of type R and return a result and take the first of the results.
I have a problem with that setup, because I have to "reuse" F(R) for both the validators and the performers, so I would either have to wait after all validators are done and then pass the original F(R) value to P(F(R)) or have to zip the validation result with F(R) and pass that into P(F(R)) < is the second approach idiomatic?
Also I have to "wait" for all F(R) to finish before passing them to the validators, unless I want to call the methods behind F(R) multiple times for each V(F(R)) - I'm missing a "andThen" method or something? Which passes the value from the Mono to the next Mono? (Is there such a concept and I've missed it? Because mono.then(otherMono) has no connection between the values)