pgriess / node-webworker

A WebWorkers implementation for NodeJS
BSD 3-Clause "New" or "Revised" License
646 stars 84 forks source link

Worker from Function #49

Open martindale opened 6 years ago

martindale commented 6 years ago

Rather than relying on disk IO, it'd be convenient to pass a function as follows to construct the WebWorker:

const Worker = require('webworker');
const worker = new Worker(function (msg) {
  return `message was: "${msg}" (${msg.length} bytes)`;
});
bhgsbatista commented 5 years ago

Try this: https://github.com/developit/greenlet