Scoped Spawn
task.gather returns results in the order the handles were passed.
Linear Handles
TaskHandle[T, E] values are linear. Awaiting or joining a handle consumes it. The compiler rejects using the same handle twice.
This is the task version of Sifr’s ownership model: a handle represents a live child task, so there is exactly one path that observes it.
Select
Usetask.select when two tasks race and the first result wins. The losing child is cancelled before the scope exits.
TaskGroup
Usetask.TaskGroup when a group of tasks should run together and you need to observe individual results.
Next Steps
Cancellation and Timeouts
Bound the lifetime of async work and handle cancellation evidence.
Ownership Across Tasks
Learn what can cross a spawn boundary.
