std1.0.0-beta-7 SafeC docs

std :: async::executor

Struct std::JoinHandle

#include <std/async/executor.h> source

generic<T> struct JoinHandle {
    ?&TaskHeader task;
}

What spawn() returns: await it (it is a future) or ask it about the task. Ready(some(v)) once the task finished with v, Ready(null) if it was aborted. Copies refer to the same task; only one may be awaited at a time.

Fields

Methods

§struct Poll<?T> poll(&Context cx)source · definition
§void drop()source · definition

Stop waiting for it (the task keeps running: dropping a JoinHandle detaches, as in Rust).

§void abort()source · definition

Cancel the task: its executor drops the future (instead of polling it again) and the task finishes as aborted. Cancelling a finished task does nothing.

§int is_finished() constsource · definition