A progression calling handler is a function that takes a base::condition
as its first argument and that can be use together with
base::withCallingHandlers()
. This function helps creating such
progression calling handler functions.
make_progression_handler(
name,
reporter = list(),
handler = NULL,
enable = getOption("progressr.enable", Sys.getenv("R_PROGRESSR_ENABLE",
interactive())),
enable_after = getOption("progressr.enable_after",
Sys.getenv("R_PROGRESSR_ENABLE_AFTER", 0)),
times = getOption("progressr.times", Sys.getenv("R_PROGRESSR_TIMES", +Inf)),
interval = getOption("progressr.interval", Sys.getenv("R_PROGRESSR_INTERVAL", 0)),
intrusiveness = 1,
clear = getOption("progressr.clear", Sys.getenv("R_PROGRESSR_CLEAR", TRUE)),
target = "terminal",
...
)
(character) Name of progression handler.
(environment) A reporter environment.
(function) Function take a progression condition as the first argument.
(logical) If FALSE, then progress is not reported.
(numeric) Delay (in seconds) before progression updates are reported.
(numeric) The maximum number of times this handler should report progression updates. If zero, then progress is not reported.
(numeric) The minimum time (in seconds) between successive progression updates from this handler.
(numeric) A non-negative scalar on how intrusive (disruptive) the reporter to the user.
(logical) If TRUE, any output, typically visual, produced by a reporter will be cleared/removed upon completion, if possible.
(character vector) Specifies where progression updates are rendered.
Additional arguments passed to make_progression_handler()
or not used.
A function of class progression_handler
that takes a
progression condition as its first and only argument.
The inner details of progression handlers and how to use this function
are still to be documented. Until then, see the source code of existing
handlers for how it is used, e.g. progressr::handler_txtprogressbar
.
Please use with care as things might change.