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, value = FALSE, recursive = 0, sleep = 1,
progress = getOption("future.progress", FALSE), ...)
a list, an environment, or a list environment holding futures that should be resolved. May also be a single Future.
(optional) integer or logical index specifying the subset of elements to check.
If TRUE, the values are retrieved, otherwise not.
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.
Number of seconds to wait before checking if futures have been resolved since last time.
If TRUE textual progress summary is outputted. If a
function, the it is called as progress(done, total)
every time a
future is resolved.
Not used
Returns x
(regardless of subsetting or not).
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))
.