Apply an asynchronous function to each element of a vector
async_map(.x, .f, ..., .args = list(), .limit = Inf)
Deferred value that is resolved after all deferred values
from the application of .f
are resolved.
Other async iterators:
async_detect()
,
async_every()
,
async_filter()
synchronise(async_map(
seq(10, 100, by = 10) / 100,
function(wait) delay(wait)$then(function() "OK")
))
#> [[1]]
#> [1] "OK"
#>
#> [[2]]
#> [1] "OK"
#>
#> [[3]]
#> [1] "OK"
#>
#> [[4]]
#> [1] "OK"
#>
#> [[5]]
#> [1] "OK"
#>
#> [[6]]
#> [1] "OK"
#>
#> [[7]]
#> [1] "OK"
#>
#> [[8]]
#> [1] "OK"
#>
#> [[9]]
#> [1] "OK"
#>
#> [[10]]
#> [1] "OK"
#>