mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-28 04:54:20 +00:00
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:
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 {
|
||||
|
||||
Reference in new issue
Block a user