inst/vignettes-static/incl/future-1-overview-example2.R

pid <- Sys.getpid()
pid
a %<-% {
  pid <- Sys.getpid()
  cat("Future 'a' ...\n")
  3.14
}
b %<-% {
  rm(pid)  ## no effect on global 'pid'
  cat("Future 'b' ...\n")
  Sys.getpid()
}
c %<-% {
  cat("Future 'c' ...\n")
  2 * a
}
b
c
a
pid

Try the future package in your browser

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

future documentation built on July 9, 2023, 6:31 p.m.