All predicates are running in parallel, and the returned match is not guaranteed to be the first one.
async_detect(.x, .p, ..., .limit = Inf)A deferred value for the result.
Other async iterators:
async_every(),
async_filter(),
async_map()
httpbin <- webfakes::new_app_process(
webfakes::httpbin_app(),
opts = webfakes::server_opts(num_threads = 3)
)
synchronise(async_detect(
c(httpbin$url("/status/404"), httpbin$url("/get"),
httpbin$url("/status/403")),
async_sequence(http_head, function(x) x$status_code == 200)
))
#> [1] "http://127.0.0.1:38889/get"