A wrapper around parallel::parLapply() that handles evoland_db connection management.
It uses a PSOCK cluster (via parallel::makeCluster()) to support Windows and ensures a clean
environment for each worker.
Arguments
- items
A list or vector of items to iterate over.
- worker_fun
A function to apply to each item. Must accept
itemas the first argument anddb(the database instance) as the second argument.- db
The current evoland_db instance (typically
self).- cores
Integer. Number of cores to use.
- ...
Additional arguments passed to
worker_fun.
Value
A list of results, same as lapply().