A Delayed version of a function may be called to generate Delayed objects

delayed(expr, sequential = FALSE, expect_error = FALSE)

delayed_fun(fun, sequential = FALSE, expect_error = FALSE)

Arguments

expr

expression to delay

sequential

if TRUE, never parallelize this task

expect_error

if TRUE, pass error to downstream tasks instead of halting computation

fun

function to delay

Examples

d <- delayed(3 + 4) d$compute()
#> [1] 7
adder <- function(x, y) { x + y } delayed_adder <- delayed_fun(adder) z <- delayed_adder(3, 4) z$compute()
#> [1] 7