Similar to base::lapply()
or purrr::map
, but promise-aware: the .f
function is permitted to return promises, and while lapply
returns a list,
promise_map
returns a promise that resolves to a similar list (of resolved
values only, no promises).
promise_map(.x, .f, ...)
A promise that resolves to a list (of values, not promises).
promise_map
processes elements of .x
serially; that is, if .f(.x[[1]])
returns a promise, then .f(.x[[2]])
will not be invoked until that promise
is resolved. If any such promise rejects (errors), then the promise returned
by promise_map
immediately rejects with that err.