You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Async.Parallel's optional degree of parallelism parameter was added late in the game, but is critical - dumping an arbitrary unbounded number of work items onto the threadpool is not something that should be easy and/or the default thing to do without due consideration for how that will work under stess.
There are some other shortcomings, which frequently lead to various bespoke helpers proliferating:
pipelining is painful, necessitating an explicit argument name (e.g. fun computations -> Async.Parallel(computations, maxDegreeOfParallelism=dop) etc) (note this is not the case for Async.Sequential)
A common case is to use this to run but await failure of multiple Async<unit> tasks. Having to use |> Async.Ignore<unit[]> is ugly for that (and most people probably do |> Async.Ignore, which prevents the compiler from helping you if your computations start to return values where they previously returned unit)
Replaces #129. TaskEx top level issue: #139
Async.Parallel's optional degree of parallelism parameter was added late in the game, but is critical - dumping an arbitrary unbounded number of work items onto the threadpool is not something that should be easy and/or the default thing to do without due consideration for how that will work under stess.There are some other shortcomings, which frequently lead to various bespoke helpers proliferating:
fun computations -> Async.Parallel(computations, maxDegreeOfParallelism=dop)etc) (note this is not the case forAsync.Sequential)Async.Paralleland direct consumption within an app might be useful)Current proposed APIs (will be updated inline based on any discussion below):
NOTES:
Async<unit>tasks. Having to use|> Async.Ignore<unit[]>is ugly for that (and most people probably do|> Async.Ignore, which prevents the compiler from helping you if your computations start to return values where they previously returnedunit)Task, considering cancellation tokens (see TaskEx: Async.startImmediateAsTask #142) and unwrappingAggregateExceptions (see TaskEx: AwaitTaskCorrect / Task.toAsync / Async.ofTask #141). Providing an equivalent of this that works well withtaskexpressions should likely be prototyped alongside any permanent API for this. Example impl. Also, perhaps aTask.sequentialmight make senseThrottledin the name is pretty well established in multiple internal library suites, and in posts such as https://www.compositional-it.com/news-blog/improved-asynchronous-support-in-f-4-7