method Handle.join
Waits for the task: its value, its error, or Cancelled (§8.3).
Example:
fn work(n: i64) -> i64 => n * 2
fn main() io {
scope {
let h = spawn work(21)
print("{h.join()!}")
}
}Output
42
pub(api) fn join() -> T | E | CancelledSince. 1.0.0-beta
Returns
T
Errors
ECancelled@error- the error `E` of the task, `Cancelled` when it was cancelled.
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/task.oxl:22