View source: R/backend_api-11.SequentialFutureBackend-class.R
sequential | R Documentation |
A sequential future is a future that is evaluated sequentially in the current R session similarly to how R expressions are evaluated in R. The only difference to R itself is that globals are validated by default just as for all other types of futures in this package.
sequential(..., gc = FALSE, earlySignal = FALSE, envir = parent.frame())
gc |
If TRUE, the garbage collector run (in the process that
evaluated the future) only after the value of the future is collected.
Exactly when the values are collected may depend on various factors such
as number of free workers and whether |
earlySignal |
Specified whether conditions should be signaled as soon as possible or not. |
envir |
The environment from where global objects should be identified. |
... |
Additional named elements to |
This function is not meant to be called directly. Instead, the typical usages are:
# Evaluate futures sequentially in the current R process plan(sequential)
A Future.
## Use sequential futures
plan(sequential)
## A global variable
a <- 0
## Create a sequential future
f <- future({
b <- 3
c <- 2
a * b * c
})
## Since 'a' is a global variable in future 'f' which
## is eagerly resolved (default), this global has already
## been resolved / incorporated, and any changes to 'a'
## at this point will _not_ affect the value of 'f'.
a <- 7
print(a)
v <- value(f)
print(v)
stopifnot(v == 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.