Async

async


Builtin (async func args...) Calls a function asynchronously with a given set of arguments

Note: The function is started in a separate context, with no access to the others, preventing any concurrency problems.

Author: @SuperFola

Parameters

  • func: the function to call
  • args...: the arguments of the function

Example

(let foo (fun (a b) (+ a b)))
(async foo 1 2)

await


Builtin (await future) Blocks until the result becomes available

Author: @SuperFola

Parameter

  • future: the future to wait for its result to be available

Example

(let foo (fun (a b) (+ a b)))
(let async-foo (async foo 1 2))
(print (await async-foo))