R/BatchtoolsCustomFuture-class.R

Defines functions BatchtoolsBashFuture BatchtoolsCustomFuture

Documented in BatchtoolsBashFuture BatchtoolsCustomFuture

#' @rdname BatchtoolsFuture
#' @export
BatchtoolsCustomFuture <- function(expr = NULL, substitute = TRUE, envir = parent.frame(), ...) {
  if (substitute) expr <- substitute(expr)
  assert_no_positional_args_but_first()
  
  future <- BatchtoolsFuture(expr = expr, substitute = FALSE, envir = envir, ...)
  future <- structure(future, class = c("BatchtoolsCustomFuture", class(future)))

  future
}



#' @rdname BatchtoolsFuture
#' @export
BatchtoolsBashFuture <- function(expr = NULL, substitute = TRUE, envir = parent.frame(), ...) {
  if (substitute) expr <- substitute(expr)
  assert_no_positional_args_but_first()

  future <- BatchtoolsCustomFuture(expr = expr, substitute = FALSE, envir = envir, ..., workers = 1L)
  future <- structure(future, class = c("BatchtoolsBashFuture", "BatchtoolsUniprocessFuture", class(future)))
  
  future
}

Try the future.batchtools package in your browser

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

future.batchtools documentation built on May 29, 2024, 3:18 a.m.