OxL Reference

method Handle.join

Waits for the task: its value, its error, or Cancelled (§8.3).

Example:

oxl✓ checked in CI
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 | Cancelled

Since. 1.0.0-beta

Returns

T

Errors

  • E
  • Cancelled @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

See also