Ciao!
How are you?
Do you know why it is silent? No ouput, if I add setInterval, it silent, if I remove setInterval, it works.
var Worker = require('webworker-threads').Worker;
// var w = new Worker('worker.js'); // Standard API
// You may also pass in a function:
var worker = new Worker(function(){
postMessage("I'm working before postMessage('ali').");
setInterval(function() {
postMessage("I'm working before postMessage('ali').");
}, 1000)
this.onmessage = function(event) {
postMessage('Hi ' + event.data);
// self.close();
};
});
worker.onmessage = function(event) {
console.log("Worker said : " + event.data);
};
worker.postMessage('ali');
Ciao! How are you? Do you know why it is silent? No ouput, if I add setInterval, it silent, if I remove setInterval, it works.