async (version 0.0.0.9004)

async_sequence: Compose asynchronous functions

Description

This is equivalent to using the $then() method of a deferred, but it is easier to use programmatically.

Usage

async_sequence(..., .list = NULL)

Arguments

...

Asynchronous functions to compose.

.list

Mose asynchronous functions to compose.

Value

Asynchronous function, the composition of all input functions. They are performed left to right, the ones in .list are the last ones.

See Also

Other async control flow: async_reflect, async_retryable, async_retry, async_try_each, async_until, async_whilst

Examples

Run this code
# NOT RUN {
check_url <- async_sequence(
  http_head, function(x) identical(x$status_code, 200L))
synchronise(check_url("https://eu.httpbin.org/status/404"))
synchronise(check_url("https://eu.httpbin.org/status/200"))
# }

Run the code above in your browser using DataLab