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", interactive()),
enable_after = getOption("progressr.enable_after", 0),
times = getOption("progressr.times", +Inf),
interval = getOption("progressr.interval", 0),
intrusiveness = 1,
clear = getOption("progressr.clear", TRUE),
target = "terminal",
...
)

## Arguments

name (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.

## Value

A function of class progression_handler that takes a progression condition as its first and only argument.

## Details

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.

base::withCallingHandlers().