Anyone with some good examples of using core async with pipelines? I have 5 non-blocking http calls which needs to be done like 1, 2, 3, 4, 5 (each function returns a core-async-channel). If step 1 fails I cannot continue to step 2 and I must act on this failure. Right now I got theese nested go-blocks.
will try to come up with an example gist later this evening
(async/go
(try
(let [r1 (async/<! (http/r1))
r2 (async/<! (http/r2))
r3 (async/<! (http/r3))
r4 (async/<! (http/r4))
r5 (async/<! (http/r5))]
(prn [:ok r1 r2 r3 r3 r4 r5]))
(catch Throwable e e)))
@souenzzo that code meant more than a thousand words to me. Thank you a lot!
instead of having everything in a go-block I had my own functions with their own go-blocks, making things complex 🙂/ i misunderstood the scoping.