Parallelising Heterogeneous Async Calls
2025-12-04
This is a post for the FSharp Advent Calendar 2025.
A particular feature of F# 10 got me thinking about approaches to parallelism, past and present.
Async.Parallel This system library function is built for orchestrating async calls with homogenous return types. It has an overload that permits controlling the degree of parallelism.
static member Parallel: computations: seq<Async<'T>> -> Async<'T array> It’s great for situations where we want to make multiple calls to the same api endpoint with different arguments - because each call expects the same response, we end up with a collection of the response type when all the calls are complete. And given the calls are made in parallel, we might only have to wait as long as the longest call.
…