R/BatchtoolsUniprocessFuture-class.R

Defines functions BatchtoolsInteractiveFuture BatchtoolsLocalFuture BatchtoolsUniprocessFuture

Documented in BatchtoolsInteractiveFuture BatchtoolsLocalFuture BatchtoolsUniprocessFuture

#' @rdname BatchtoolsFuture
#' @export
BatchtoolsUniprocessFuture <- 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, ..., workers = 1L)
  future <- structure(future, class = c("BatchtoolsUniprocessFuture", class(future)))
  
  future
}


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

  future <- BatchtoolsUniprocessFuture(expr = expr, substitute = FALSE, envir = envir, ...)
  future <- structure(future, class = c("BatchtoolsLocalFuture", class(future)))
  
  future
}


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

  future <- BatchtoolsUniprocessFuture(expr = expr, substitute = FALSE, envir = envir, ...)
  future <- structure(future, class = c("BatchtoolsInteractiveFuture", 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.