Method in task · Task compiler

Task::cancel

pub fn cancel()
Import
use task::{Task};
Source: compiler/src/prelude/task.hy

Asks the task to stop.

It unwinds at its next suspension point (at once, if it is suspended), running its defer blocks, and join then returns Err(TaskError::Cancelled). Cancelling a finished task does nothing. Code inside shield finishes first.

Called on a Task value as value.cancel(…).

See also#

↑ ↓ navigate ↵ open