Task and Task Cancellation
Creating structured tasks, checking cancellation and cooperative cancellation.
Welcome
`Task` is the fundamental unit of concurrency in Swift. It runs async work and supports structured cancellation for clean resource management.
Creating a Task
```swift
Task {
let user = try await fetchUser(id: 1)
print(user.name)
}
```
`Task` creates a new concurrent execution context.