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.
resolve(
x,
idxs = NULL,
recursive = 0,
result = FALSE,
stdout = FALSE,
signal = FALSE,
force = FALSE,
sleep = getOption("future.wait.interval", 0.01),
...
)
Returns x
(regardless of subsetting or not).
If signal
is TRUE and one of the futures produces an error, then
that error is produced.
A Future to be resolved, or a list, an environment, or a list environment of futures to be resolved.
(optional) integer or logical index specifying the subset of elements to check.
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.
(internal) If TRUE, the results are retrieved, otherwise not. Note that this only collects the results from the parallel worker, which can help lower the overall latency if there are multiple concurrent futures. This does not return the collected results.
(internal) If TRUE, captured standard output is relayed, otherwise not.
(internal) If TRUE, captured conditions are relayed, otherwise not.
(internal) If TRUE, captured standard output and captured conditions already relayed is relayed again, otherwise not.
Number of seconds to wait before checking if futures have been resolved since last time.
Not used.
This function is resolves synchronously, i.e. it blocks until x
and
any containing futures are resolved.
To resolve a future variable, first retrieve its
Future object using futureOf()
, e.g.
resolve(futureOf(x))
.