Well, as silly as I feel for having asked this question, it has a really cool outcome. In https://github.com/wlandau/targets/pull/248, I built an app and module to monitor the progress of a targets pipeline. It refreshes tar_visnetwork() every few seconds to update the user on what the pipeline is doing. Example:
# Install targets
# remotes::install_github("wlandau/targets")
# Define an example _targets.R file with a slow pipeline.
library(targets)
tar_script({
sleep_run <- function(...) {
Sys.sleep(10)
}
tar_pipeline(
tar_target(settings, sleep_run()),
tar_target(data1, sleep_run(settings)),
tar_target(data2, sleep_run(settings)),
tar_target(data3, sleep_run(settings)),
tar_target(model1, sleep_run(data1)),
tar_target(model2, sleep_run(data2)),
tar_target(model3, sleep_run(data3)),
tar_target(figure1, sleep_run(model1)),
tar_target(figure2, sleep_run(model2)),
tar_target(figure3, sleep_run(model3)),
tar_target(conclusions, sleep_run(c(figure1, figure2, figure3)))
)
})
# Run the pipeline in a separate R process.
px <- tar_make(callr_function = callr::r_bg)
# Run the app in the main process. Watch it refresh every 10 seconds.
# New targets should appear built each time.
tar_watch(seconds = 10, outdated = FALSE, targets_only = TRUE)