This is sometimes useful to start a deferred chain.

async_constant(value = NULL)

Arguments

value

The value to resolve to.

Value

A deferred value.

Details

Note that the evaluation of value is forced when the deferred value is created.

Examples

afun <- async(function() {
  async_constant(1/100)$
    then(function(x) delay(x))$
    then(function(x) print(x))
})
synchronise(afun())
#> [1] TRUE
#> [1] TRUE