R/make_calling_handler.R

Defines functions make_calling_handler

make_calling_handler <- function(handlers) {
  if (length(handlers) > 1L) {
    calling_handler <- function(p) {
      finished <- FALSE
      for (kk in seq_along(handlers)) {
        handler <- handlers[[kk]]
        if (handler(p)) finished <- TRUE
      }
      finished
    }
  } else {
    calling_handler <- handlers[[1]]
  }
  calling_handler
}

Try the progressr package in your browser

Any scripts or data that you put into this service are public.

progressr documentation built on Aug. 11, 2023, 1:07 a.m.