interface Task.Context
Represents the execution context for Tasks, supporting cancellation, supervision, and child contexts.
Properties
children
Iterable of child contexts
childrenDefinition
get children(): Iterable<Task.Context>;
launch
Launches a task as a background Job in this context. Use for running tasks that can be cancelled or joined later.
launchDefinition
launch: {
<R = void>(task: Task<R>, options?: (Task.ChildOptions & {
args?: undefined | [];
}) |undefined):Task.Job<R>;
<R = void, A extends readonly any[] = []>(task: Task<R, A>, options: (Task.ChildOptions & {
args: A;
}) |undefined):Task.Job<R>;
};
onCancelled
Registers a callback for cancellation
onCancelledDefinition
onCancelled: (cleanup: Cleanup) => DisposableCallback;
parent
Parent context, if any
parentDefinition
get parent(): Task.Context | undefined;
run
Executes the next task within a running context. Use for chaining tasks or running a task as part of a sequence.
run