researchgate / node-file-processor

Node.js utility for mass-processing files in parallel.
MIT License
10 stars 3 forks source link

feat: Support configuring how workers are invoked #34

Closed justinvdm closed 4 years ago

justinvdm commented 4 years ago

Adds an invokeWorker option to allow configuring how workers are invoked.

Reason I'm needing this is to provide additional arguments to the worker function, though accepting a wrapper function like this gives us flexibility for other use cases too:

new FileProcessor(pattern, workerPath, {
  invokeWorker(worker, filePath, callback) {
    worker(filePath, arg2, arg3, callback);
  }
});
justinvdm commented 4 years ago

Potentially solves #11

researchgate-bot commented 4 years ago

:tada: This PR is included in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: