Skip to content

FoldWhile/FoldUntil with an async predicate #1031

Answered by louthy
fjmorel asked this question in Q&A
Discussion options

You must be logged in to vote

You can use SequenceSerial and TraverseSerial to turn a sequence of asynchronous actions into a asynchronous action of sequence.

I haven't got a debugger to hand, but try this:

    guids.SequenceSerial(GetDataAsync);

It will only return a sequence if all items succeed, otherwise you get the first error. There's also SequenceParallel and TraverseParallel. The rules are the same, but the error you get back might not be the first sequentially.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fjmorel
Comment options

Answer selected by fjmorel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants