future (version 1.16.0)

resolve: Resolve one or more futures synchronously

Description

This function provides an efficient mechanism for waiting for multiple futures in a container (e.g. list or environment) to be resolved while in the meanwhile retrieving values of already resolved futures.

Usage

resolve(
  x,
  idxs = NULL,
  recursive = 0,
  result = FALSE,
  stdout = FALSE,
  signal = FALSE,
  force = FALSE,
  sleep = 1,
  value = result,
  ...
)

Arguments

x

A Future to be resolved, or a list, an environment, or a list environment of futures to be resolved.

idxs

(optional) integer or logical index specifying the subset of elements to check.

recursive

A non-negative number specifying how deep of a recursion should be done. If TRUE, an infinite recursion is used. If FALSE or zero, no recursion is performed.

result

(internal) If TRUE, the results are retrieved, otherwise not.

stdout

(internal) If TRUE, captured standard output is relayed, otherwise note.

signal

(internal) If TRUE, captured conditions are relayed, otherwise not.

force

(internal) If TRUE, captured standard output and captured conditions already relayed is relayed again, otherwise not.

sleep

Number of seconds to wait before checking if futures have been resolved since last time.

value

(DEPRECATED) Use argument result instead.

Not used.

Value

Returns x (regardless of subsetting or not). If signal is TRUE and one of the futures produces an error, then that error is produced.

Details

This function is resolves synchronously, i.e. it blocks until x and any containing futures are resolved.

See Also

To resolve a future variable, first retrieve its Future object using futureOf(), e.g. resolve(futureOf(x)).