Skip to content

Instantly share code, notes, and snippets.

@ColinFay
Created April 3, 2020 20:44
Show Gist options
  • Save ColinFay/f0faffc3c686fa5c8f11801367a745f7 to your computer and use it in GitHub Desktop.
Save ColinFay/f0faffc3c686fa5c8f11801367a745f7 to your computer and use it in GitHub Desktop.
library(future)
plan(multisession)
checks <- function(x){
if(resolved(x)){
print(value(x))
} else {
later::later(~ checks(x), 2)
}
}
x <- future::future({
Sys.sleep(5)
head(iris)
})
checks(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment