wait_for(x, timeout = NULL, interval = 1)Boolean expression to evaluate.
Numeric. Maximum time (in seconds) to wait.
Numeric. The polling interval in seconds (default=1).
Invisibly returns TRUE indicating value of x after waiting for
x to be TRUE.
# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1",
based_on = file.path(exdir, "Models", "ADVAN2.mod"),
data_path = file.path(exdir, "SourceData", "THEOPP.csv"))
## requires NONMEM to be installed
if (FALSE) {
## the following are identical
m1 %>% run_nm() %>% wait_finish()
wait_for(is_finished(m1)) ## wait_finish is a more convenient form of this
}