I am chaining some calls and I need to use the outcome of 1 future in a following call.
In the example below, what would be the most elegant way to be able to use res1
?
call1()
.compose(res1 -> call2(res1))
.compose(res2 -> call3(res2, res1)) // cannot user res1 here!!
.setHandler(res -> {
/// omitted for brevity
});
I can make call2
return a map containing res1
and res2
but I wonder if there is another way.