inst/testme/test-batchtools_ssh.R

if (.Platform[["OS.type"]] != "windows") {
  library(future)
  
  message("*** batchtools_ssh() ...")
  
  plan(future.batchtools::batchtools_ssh, workers = rep("localhost", times = 2))
  supports_ssh <- tryCatch({
    f <- future(42L)
    v <- value(f)
    identical(v, 42L)
  }, error = function(e) FALSE)
  message("Supports batchtools_ssh: ", supports_ssh)
  
  if (supports_ssh) {
    message("future(a) ...")
    a0 <- a <- 42
    f <- future(a)
    stopifnot(identical(f$globals$a, a0))
    v <- value(f)
    stopifnot(identical(v, a0))
  
    message("future(a, lazy = TRUE) ...")
    a0 <- a <- 42
    f <- future(a, lazy = TRUE)
    rm(list = "a")
    stopifnot(identical(f$globals$a, a0))
    v <- value(f)
    stopifnot(identical(v, a0))
  } ## if (supports_ssh)

  plan(sequential)
  
  message("*** batchtools_ssh() ... DONE")
}

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 Oct. 19, 2026, 1:07 a.m.