Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow sequential processing for a sequence of asyncs #706
Sequential processing for a sequence of asyncs
I propose we provide support for an equivalent of
Sequential processing is useful in many cases where you need to, for example, throttle a number of asynchronous computations to a certain size. For example, you have 100 messages but can only send one at a time.
The existing way of approaching this problem in F# is to manually implement a recursive function or otherwise. However, it's a general problem which I believe would be useful to have.
Pros and Cons
The advantages of making this adjustment to F# are that the utility of FSharp.Core increases.
The disadvantages of making this adjustment to F# are that there is another method on the Async type, and some users may not know the difference between
Estimated cost (XS, S, M, L, XL, XXL): S
Related suggestions: (put links to related suggestions here)
I have implemented a (crude) sample which illustrates how this may look here as a starting point. It would be useful to know what it is missing as a way of moving this forward.
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
Here's a possible implementation from F#+ https://github.com/fsprojects/FSharpPlus/blob/74990208661751e2cb341600ea3ba2e62906f5f0/src/FSharpPlus/Extensions.fs#L1021-L1028