View source: R/backend_api-01-FutureBackend-class.R
FutureBackend | R Documentation |
Configure a backend that controls how and where futures are evaluated
launchFuture()
runs a future on the backend.
interruptFuture()
interrupts a future on the backend.
stopWorkers()
stops backend workers
A ClusterFutureBackend resolves futures in parallel using any PSOCK cluster
A MulticoreFutureBackend resolves futures in parallel using forked processing on the current machine
A SequentialFutureBackend resolves futures sequentially in the current R session
A MultisessionFutureBackend resolves futures in parallel using a PSOCK cluster on the current machine
FutureBackend(
...,
earlySignal = FALSE,
gc = FALSE,
maxSizeOfObjects = getOption("future.globals.maxSize", +Inf),
interrupts = TRUE,
hooks = FALSE
)
launchFuture(backend, future, ...)
listFutures(backend, ...)
interruptFuture(backend, future, ...)
validateFutureGlobals(backend, future, ...)
stopWorkers(backend, ...)
MultiprocessFutureBackend(
...,
wait.timeout = getOption("future.wait.timeout", 24 * 60 * 60),
wait.interval = getOption("future.wait.interval", 0.01),
wait.alpha = getOption("future.wait.alpha", 1.01)
)
ClusterFutureBackend(
workers = availableWorkers(),
gc = TRUE,
earlySignal = TRUE,
interrupts = FALSE,
persistent = FALSE,
...
)
MulticoreFutureBackend(
workers = availableCores(constraints = "multicore"),
maxSizeOfObjects = +Inf,
...
)
SequentialFutureBackend(..., maxSizeOfObjects = +Inf)
MultisessionFutureBackend(workers = availableCores(), interrupts = TRUE, ...)
earlySignal |
Overrides the default behavior on whether futures
should resignal ("relay") conditions captured as soon as possible, or
delayed, for instance, until |
gc |
Overrides the default behavior of whether futures should trigger
garbage collection via |
maxSizeOfObjects |
The maximum allowed total size, in bytes, of all
objects to and from the parallel worker allows.
This can help to protect against unexpectedly large data transfers between
the parent process and the parallel workers - data that is often transferred
over the network, which sometimes also includes the internet. For instance,
if you sit at home and have set up a future backend with workers running
remotely at your university or company, then you might want to use this
protection to avoid transferring giga- or terabytes of data without noticing.
(Default: |
interrupts |
If FALSE, attempts to interrupt futures will not take place on this backend, even if the backend supports it. This is useful when, for instance, it takes a long time to interrupt a future. |
backend |
a FutureBackend. |
future |
a Future to be started. |
wait.timeout |
Number of seconds before timing out. |
wait.interval |
Baseline number of seconds between retries. |
wait.alpha |
Scale factor increasing waiting interval after each attempt. |
workers |
... |
persistent |
(deprecated) ... |
... |
(optional) not used. |
The ClusterFutureBackend
is selected by
plan(cluster, workers = workers)
.
The MulticoreFutureBackend
backend is selected by
plan(multicore, workers = workers)
.
The SequentialFutureBackend
is selected by plan(sequential)
.
The MultisessionFutureBackend
backend is selected by
plan(multisession, workers = workers)
.
FutureBackend()
returns a FutureBackend object, which inherits an
environment. Specific future backends are defined by subclasses
implementing the FutureBackend API.
launchFuture()
returns the launched Future
object.
interruptFuture()
returns the interrupted Future
object,
if supported, other the unmodified future.
stopWorkers()
returns TRUE if the workers were shut down,
otherwise FALSE.
The FutureBackend
class specifies FutureBackend API,
that all backends must implement and comply to. Specifically,
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.