async_sequence: Compose asynchronous functions

View source: R/sequence.R

async_sequenceR Documentation

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_backoff(), async_reflect(), async_retry(), async_retryable(), async_try_each(), async_until(), async_whilst()

Examples


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"))


r-lib/async documentation built on March 24, 2024, 6:20 p.m.