Closed HenrikBengtsson closed 1 year ago
library(future)
plan(sequential)
a <- 42
f <- future({
a
a <- 3.14
rm(a)
a
})
value(f)
#> [1] 42
but that's a lucky side effect, because:
a <- 42
f <- future({
a
a <- 3.14
rm(a)
a
}, lazy = TRUE)
rm(a)
value(f)
#> Error in eval(quote({ : object 'a' not found
and
library(future)
plan(cluster, workers = 1L)
a <- 42
f <- future({
a
a <- 3.14
rm(a)
a
})
value(f)
#> Error in withCallingHandlers({ : object 'a' not found
should return 42.