Std.Concurrent.Future
14 public declarations
- fail
&Std.Concurrent.Future.Future[T] -> Std.Concurrent.ConcurrentError -> BoolSettle a future with a failure. Answers whether this call settled it.
- firstSuccess
&Std.Concurrent.Cancel.Token -> &Array[fn(Std.Concurrent.Cancel.Token) -> T] -> Result[T, Std.Concurrent.ConcurrentError]Run every action and answer the first to succeed; when none does, the
- fulfil
&Std.Concurrent.Future.Future[T] -> T -> BoolSettle a future with a value. Answers whether this call settled it: a
- Future
A value another thread is producing.
- isDone
&Std.Concurrent.Future.Future[T] -> BoolWhether the future has settled.
- promise
Std.Concurrent.Future.Future[T]A future nothing settles yet;
fulfilorfailsettles it. - race
&Std.Concurrent.Cancel.Token -> &Array[fn(Std.Concurrent.Cancel.Token) -> T] -> Result[T, Std.Concurrent.ConcurrentError]Run every action and answer the first to settle, value or failure. The
- settleAll
&Array[Std.Concurrent.Future.Future[T]] -> Array[Result[T, Std.Concurrent.ConcurrentError]]Every future's outcome, in input order, once all have settled.
- start
fn() -> T -> Result[Std.Concurrent.Future.Future[T], Std.Concurrent.ConcurrentError]Run an action on a thread and answer the future of its value.
- wait
&Std.Concurrent.Future.Future[T] -> Result[T, Std.Concurrent.ConcurrentError]Wait until the future settles and answer its outcome.
- waitAll
&Array[Std.Concurrent.Future.Future[T]] -> Result[Array[T], Std.Concurrent.ConcurrentError]Wait for every future and answer their values in order, or the first
- waitUntil
&Std.Concurrent.Future.Future[T] -> &Std.Concurrent.Cancel.Token -> Result[Option[T], Std.Concurrent.ConcurrentError]Wait until the future settles or the token fires;
Nonefor the token. - waitWithin
&Std.Concurrent.Future.Future[T] -> Int -> Result[Option[T], Std.Concurrent.ConcurrentError]Wait at most
millis;Nonewhen the future had not settled by then. - within
Int -> fn(Std.Concurrent.Cancel.Token) -> T -> Result[Option[T], Std.Concurrent.ConcurrentError]Run an action with a token that fires after
millis;Nonewhen the
