We want a method similar to LINQ Select, which takes an IEnumerable<A> and a Func<A, Task<B>> and awaits the results of applying the func to each argument in a linear order, e.g. the second task is started once the first one finishes.
This contrasts Task.WhenAll, since Tasks are eagerly ran and thus not referentially transparent. In order to run tasks one after the other, we need to lazily create the Tasks themselves, hence the usage in a Select (and maybe Collect) method.
These should have obvious naming that highlights the sequential processing of their sequences' values.
We want a method similar to LINQ
Select
, which takes anIEnumerable<A>
and aFunc<A, Task<B>>
and awaits the results of applying the func to each argument in a linear order, e.g. the second task is started once the first one finishes.This contrasts
Task.WhenAll
, since Tasks are eagerly ran and thus not referentially transparent. In order to run tasks one after the other, we need to lazily create the Tasks themselves, hence the usage in aSelect
(and maybeCollect
) method.These should have obvious naming that highlights the sequential processing of their sequences' values.