future
workers.R/tar_make_future.R
tar_make_future.Rd
This function is like tar_make()
except that targets
run in parallel with transient future
workers. It requires
that you declare your future::plan()
inside the _targets.R
script.
future
is not a strict dependency of targets
,
so you must install future
yourself.
tar_make_future( names = NULL, reporter = "verbose", workers = 1L, callr_function = callr::r, callr_arguments = list() )
names | Names of the targets to build or check. Set to |
---|---|
reporter | Character of length 1, name of the reporter to user. Controls how messages are printed as targets run in the pipeline. Choices:
|
workers | Positive integer, maximum number of transient
|
callr_function | A function from |
callr_arguments | A list of arguments to |
NULL
except if callr_function = callr::r_bg()
, in which case
a handle to the callr
background process is returned. Either way,
the value is invisibly returned.
To configure tar_make_future()
with a computing cluster,
see the future.batchtools
package documentation.
if (identical(Sys.getenv("TAR_LONG_EXAMPLES"), "true")) { tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ future::plan(future::multisession) tar_option_set() list(tar_target(x, 1 + 1)) }, ask = FALSE) tar_make_future() }) }