powered by
An alternative dispatch that uses parallel::parLapply-style execution but with supervision. This is a simpler interface for basic parallel apply.
pool_lapply(X, FUN, ..., pool = NULL, chunk_size = 1L)
A list of results.
List or vector to iterate over.
Function to apply to each element.
Additional arguments to FUN.
A shard_pool object. If NULL, uses current pool.
shard_pool
Integer. Elements per chunk (default 1).
# \donttest{ pool_create(2) result <- pool_lapply(1:4, function(x) x^2, pool = pool_get()) pool_stop() # }
Run the code above in your browser using DataLab