async_race_some: A deferred value that resolves when the specified number of...

View source: R/race.R

async_race_someR Documentation

A deferred value that resolves when the specified number of deferred values resolve, or is rejected when one of them is rejected

Description

These functions are similar to when_some() and when_any(), but they do not ignore errors. If a deferred is rejected, then async_race_some() and async_race() are rejected as well.

Usage

async_race_some(count, ..., .list = list())

async_race(..., .list = list())

Arguments

count

Number of deferred values that need to resolve.

...

Deferred values.

.list

More deferred values.

Details

async_race() is a special case of ⁠count = ⁠: it resolves or is rejected as soon as one deferred resolves or is rejected.

async has auto-cancellation, so if the required number of deferred values are resolved, or any deferred value is rejected, the rest are cancelled.

Value

A deferred value, that is conditioned on all deferred values in ... and .list.


r-lib/async documentation built on Nov. 19, 2024, 12:08 p.m.