Block the current runtime until the expression returns TRUE
.
wait_until(
expr,
envir = parent.frame(),
timeout = Inf,
interval = 0.1,
later_run_now = TRUE
)
an expression to check, supports quasiquotation.
the environment in which the expression is to be evaluated.
raise an error if this amount of time in second has passed.
delay between retries.
execute later::run_now()
periodically later
is loaded?
s <- Sys.time()
system.time(wait_until(Sys.time() - s > 1))
#> user system elapsed
#> 0.005 0.001 1.041
z <- 0
later::later(function() z <<- 1, 1)
wait_until(z == 1)
z == 1
#> [1] TRUE