File: handler_void.R

package info (click to toggle)
r-cran-progressr 0.15.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,132 kB
  • sloc: sh: 13; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#' Progression Handler: No Progress Report
#'
#' @inheritParams make_progression_handler
#'
#' @param \ldots Additional arguments passed to [make_progression_handler()].
#'
#' @examples
#' \donttest{\dontrun{
#' handlers(handler_void())
#' with_progress(y <- slow_sum(1:100))
#' print(y)
#' }}
#'
#' @details
#' This progression handler gives not output - it is invisible and silent.
#'
#' @export
handler_void <- function(intrusiveness = 0, target = "void", enable = FALSE, ...) {
  reporter <- local({
    list(
      initiate = function(config, state, progression, ...) NULL,
      update = function(config, state, progression, ...) NULL,
      finish = function(config, state, progression, ...) NULL
    )
  })
  
  make_progression_handler("void", reporter, intrusiveness = intrusiveness, target = target, enable = enable, ...)
}