I have an ordered list of futures that I like run sequentially in-order, one-by-one and until all futures have been successfully executed or an error is encountered. Generally speaking, I’m looking for a way to automatically
and_then all my futures from the list.
My use case is to create a list of todos items via REST calls that preserve the order the items were created. It makes sense to create a todo item
n if the item
n-1 has been successfully created.
So far, the only hint I found is StackOverflow question, but – as far as I understand – the solution does not take the futures’s results into account.
I hope somebody has an idea, because I don’t know how to approach this other than writing a macro to actually
.and_then the futures. But there must be better way.
Thanks in advance!