if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
schedule <- crew_schedule()
schedule$start()
schedule$push(task = mirai::mirai(1 + 1))
schedule$push(task = mirai::mirai(2 + 2))
Sys.sleep(4)
schedule$collect(throttle = FALSE)
schedule$pop()$data # numeric result
schedule$pop()$data # numeric result
schedule$pop()$data # NULL
}
Run the code above in your browser using DataLab