tar_active: Show if the pipeline is running.

View source: R/tar_active.R

tar_activeR Documentation

Show if the pipeline is running.

Description

Return TRUE if called in a target or ⁠_targets.R⁠ and the pipeline is running.

Usage

tar_active()

Value

Logical of length 1, TRUE if called in a target or ⁠_targets.R⁠ and the pipeline is running (FALSE otherwise).

See Also

Other utilities: tar_backoff(), tar_call(), tar_cancel(), tar_definition(), tar_described_as(), tar_envir(), tar_group(), tar_name(), tar_path(), tar_path_script(), tar_path_script_support(), tar_path_store(), tar_path_target(), tar_source(), tar_store()

Examples

if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_active() # FALSE
tar_script({
  message("Pipeline running? ", tar_active())
  tar_target(x, tar_active())
})
tar_manifest() # prints "Pipeline running? FALSE"
tar_make() # prints "pipeline running? TRUE"
tar_read(x) # TRUE
})
}

wlandau/targets documentation built on April 21, 2024, 6:04 p.m.