It was nice to see the worker_threads in nodejs. So, i wrote a small wrapper over them https://ift.tt/2Nl5FP9 World:const { WorkerGroup } = require('iworker'); const wg = new WorkerGroup(); const worker = wg.newThread({ async hello(world) { return 'Hello' + world + '!'; } }); await worker.hello('World'); // "Hello World!" Warning: worker_threads is experimental featureStability: 1 - Experimental. This feature is still under active development and subject to non-backwards compatible changes, or even removal, in any future version. Use of the feature is not recommended in production environments. Experimental features are not subject to the Node.js Semantic Versioning model.
Submitted July 03, 2018 at 07:03AM by kwolfy11
No comments:
Post a Comment