File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1183,10 +1183,16 @@ module Task =
11831183 )
11841184 )
11851185
1186+ /// Creates a single Task<unit> that will complete when all of the Task<unit> objects in an enumerable collection have completed.
1187+ let inline WhenAllUnits ( units : seq < Task < unit >>) : Task < unit > =
1188+ task {
1189+ let! ( _ : unit []) = Task.WhenAll units
1190+ return ()
1191+ }
11861192
11871193 /// Converts a Task into Task<unit>
1188- let ToTaskUnit ( t : Task ) =
1189- let continuation _ = ()
1194+ let inline ToTaskUnit ( t : Task ) =
1195+ let inline continuation _ = ()
11901196 t.ContinueWith continuation
11911197
11921198 /// Creates a task that runs the given task and ignores its result.
@@ -1219,7 +1225,6 @@ module Task =
12191225 let Parallel ( tasks : seq < unit -> Task < 'a >>) : ( Task < 'a []>) =
12201226 tasks
12211227 |> Seq.map ( fun t -> t())
1222- |> Array.ofSeq
12231228 |> Task.WhenAll
12241229
12251230 /// Creates a task that executes all the given tasks.
You can’t perform that action at this time.
0 commit comments