Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Worker not supported #18345

Closed
goblin01dev opened this issue Jan 24, 2018 · 2 comments
Closed

Web Worker not supported #18345

goblin01dev opened this issue Jan 24, 2018 · 2 comments
Labels
question Issues that look for answers.

Comments

@goblin01dev
Copy link

  • Version: 8.9.3
  • Platform: Windows 10 64-bit
  • Subsystem: None

Well, i tried to make a project and making for it a counter to count how many time does it work. And, i made it in worker to increase performance of application, using following code:

var counter;
var time;
if (typeof(Worker) != "undefined") {
  counter = new Worker("count.js");
  counter.onmessage = function() {
    time = time + 1;
  }
} else {
  console.warn("No Worker support");
}

This is the code of core. This one is for worker itself.

var i;
setInterval(()=>{
    i = 'placeholder';
    postMessage(i);
},1000);

But if I run it, i get a warning in console: No Worker support.

@vkurchatkin
Copy link
Contributor

Node.js doesn't implement worker API. You should use child_process module instead.

@vkurchatkin vkurchatkin added the question Issues that look for answers. label Jan 24, 2018
@mhdawson
Copy link
Member

mhdawson commented Feb 1, 2018

@goblin01dev You may want to comment here: nodejs/worker#1 to add details of your use case. That would support efforts around workers in node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants