Created
July 8, 2025 11:24
-
-
Save jacobsapps/e50b8126a9a4fa7e649a670a69544719 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var task: Task<Void, Error>? | |
task = Task { | |
async let name = fetchUserName() | |
async let avatar = fetchUserAvatar() | |
// this will throw if either child task checks cancellation | |
try await (name, avatar) | |
} | |
task?.cancel() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment