std/async/promise▲toc

.

type promisestd/async/promise/promise: V -> V<a>

A promise that carries a value of type a. A promise is initially empty but can be awaited asynchronously until it gets resolvestd/async/promise/resolve: forall<a> (p : promise<a>, value : a) -> <async,exn> ()d unblocking any await operations. After that a promise stays resolved and any await will return immediately. It is an error to try to resolve a promise more than once.

Await a promise; returns immediately if the promise was already resolved and otherwise waits asynchronously.

Resolve a promise to value. Raises an exception if the promise was already resolved.

Resolve a promise to value. Returns False if the promise was already resolved.

private import std/core/typesstd/core/types, std/core/hndstd/core/hnd, std/core/exnstd/core/exn, std/core/boolstd/core/bool, std/core/orderstd/core/order, std/core/charstd/core/char, std/core/intstd/core/int, std/core/vectorstd/core/vector, std/core/bytesstd/core/bytes, std/core/bslicestd/core/bslice, std/core/stringstd/core/string, std/core/sslicestd/core/sslice, std/core/liststd/core/list, std/core/maybestd/core/maybe, std/core/maybe2std/core/maybe2, std/core/eitherstd/core/either, std/core/resultstd/core/result, std/core/tuplestd/core/tuple, std/core/lazystd/core/lazy, std/core/showstd/core/show, std/core/debugstd/core/debug, std/core/delayedstd/core/delayed, std/core/consolestd/core/console, std/corestd/core, std/async/internalstd/async/internal, std/async/asyncstd/async/async