SagaSaga
Standard Library

Std.Async

Lightweight async/await built on top of the Actor model.

Types

Future

opaque type Future a

Effects

Async

effect Async {
  fun async : (f: Unit -> a) -> Future a
  fun await : (future: Future a) -> a
}

Async effect for spawning concurrent computations and awaiting their results.

Handlers

async_handler

handler async_handler for Async needs {Process, Actor a}

Default handler for Async that spawns an actor per async call.

Functions

all

fun all : (futures: List (Future a)) -> List a needs {Async}

Awaits all futures in order and collects the results into a list.