menu
TaskScope
import { TaskScope } from "destack:async";
Structured owner of spawned tasks.
Asynchronous disposal waits for every child before it completes. Cancellation requests are delivered cooperatively at cancellable asynchronous operations.
1export struct TaskScope {2 static open(): TaskScope;3 spawn<T: Copy>(body: () => Task<T>): Task<T>;4 cancel(): void;5 async asyncDispose(): Promise<void>;6 drop(): void;7}