TaskEx: parallelLimit #143
Labels
feature request
New feature or enhancement request
topic: task-ex
Related to the proposed new TaskEx library, which should get its own oss haven
Milestone
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.Parallel
and 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 unwrappingAggregateException
s (see TaskEx: AwaitTaskCorrect / Task.toAsync / Async.ofTask #141). Providing an equivalent of this that works well withtask
expressions should likely be prototyped alongside any permanent API for this. Example impl. Also, perhaps aTask.sequential
might make senseThrottled
in 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-7The text was updated successfully, but these errors were encountered: