WLJS LogoWLJS Notebook

TaskAbort

TaskAbort[task] generates an interrupt to abort the current execution of a task.

This stops a running task and cancels any pending executions.

Examples

task = SessionSubmit[ScheduledTask[Print["tick"], 1]];
TaskAbort[task]
(* Abort a long-running task *)
TaskAbort[$CurrentTask]
(* Check task status after abort *)
task = SessionSubmit[Pause[100]];
TaskAbort[task];
TaskStatus[task]

*See the official Wolfram Language Reference for more details.

On this page