node-webworker icon indicating copy to clipboard operation
node-webworker copied to clipboard

Worker from Function

Open martindale opened this issue 7 years ago • 1 comments

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)`;
});

martindale avatar May 28 '18 22:05 martindale

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

bhgsbatista avatar Jun 30 '19 20:06 bhgsbatista