crew_retry {crew} | R Documentation |
Retry code.
Description
Repeatedly retry a function while it keeps returning FALSE
and exit the loop when it returns TRUE
Usage
crew_retry(
fun,
args = list(),
seconds_interval = 1,
seconds_timeout = 60,
max_tries = Inf,
error = TRUE,
message = character(0),
envir = parent.frame()
)
Arguments
fun |
Function that returns |
args |
A named list of arguments to |
seconds_interval |
Nonnegative numeric of length 1,
number of seconds to wait between calls to |
seconds_timeout |
Nonnegative numeric of length 1, number of seconds to loop before timing out. |
max_tries |
Maximum number of calls to |
error |
Whether to throw an error on a timeout or max tries. |
message |
Character of length 1, optional error message if the wait times out. |
envir |
Environment to evaluate |
Value
NULL
(invisibly).
See Also
Other utility:
crew_assert()
,
crew_clean()
,
crew_deprecate()
,
crew_eval()
,
crew_random_name()
,
crew_terminate_process()
,
crew_terminate_signal()
,
crew_worker()
Examples
crew_retry(fun = function() TRUE)
[Package crew version 0.9.5 Index]