Rework Task.first to a better name/behavior of Task.select (#21)

* Rework Task.first to a better name/behavior of Task.select

* Downgrade UnsafeResumption to internal
This commit is contained in:
Philippe Hausler authored and GitHub committed 2022-01-24 13:38:51 -08:00
1 parent b015c5e49e
commit 21520e710c
6 files changed
+124 -138

No files matched your search

@@ -48,7 +48,7 @@ where
}
mutating func apply(_ task1: Task<Partial, Never>?, _ task2: Task<Partial, Never>?, _ task3: Task<Partial, Never>?) async rethrows -> Element? {
switch await Task.first([task1, task2, task3].compactMap { $0 }) {
switch await Task.select([task1, task2, task3].compactMap { $0 }).value {
case .first(let result, let iterator):
do {
guard let value = try state.0.resolve(result, iterator) else {