lapply using future package in asynchronous way

lapply_async(
x,
fun,
...,
.ncores = 0,
.call_back = NULL,
.packages = NULL,
.envir = environment(),
.globals = TRUE,
.gc = TRUE,
.as_datatable = FALSE,
.nrows = 0
)

lapply_async3(
x,
fun,
...,
.globals = TRUE,
.gc = TRUE,
.callback = NULL,
.ncores = 0
)

## Arguments

x, fun, ... (See lapply) Number of cores to use. If the value is 0, the number of cores will be determined by rave_options('max_worker'). A function takes current iteration number as argument, can be NULL. NULL be default, then the function will detect attached packages automatically. Otherwise you have to specify the packages that you want to load. internally used Automatically detect variables. See ?future::future Clean up environment after each iterations? Recommended for large datasets. logical, return result as data.frame. Experimental. integer, if .as_datatable=TRUE, number of rows expected. function or NULL, callback function to monitor updates.

## Examples

if (FALSE) {
lapply_async(1:10, function(x){
Sys.sleep(2) # Run for 1 secs
Sys.getpid()
}, .ncores = 3, .call_back = function(i){
cat('Running iteration -', i, '\n')
})
}