Skip to content

Running a pipeline as a background job in target markdown #1499

Closed Answered by wlandau
jl5000 asked this question in Help
Discussion options

You must be logged in to vote

By design, tar_make(as_job = TRUE) returns control to you immediately. That way, your R console is free to run e.g. tar_progress_summary() and tar_visnetwork() while the pipeline runs in the background. If you want to block the R Markdown document until the pipeline finishes, you could get the PID of the pipeline from tar_process(), then use the ps package to check if the process is still alive (from inside your while() loop).

tar_active() is used to check if the current context is inside a call to tar_make() (either in a target or somewhere in _targets.R). The main use case is if you want custom code in _targets.R to know if you are running the pipeline with tar_make() or just inspecting…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jl5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants