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

setInterval problem #23

Closed
s2dent opened this issue Feb 15, 2014 · 2 comments
Closed

setInterval problem #23

s2dent opened this issue Feb 15, 2014 · 2 comments

Comments

@s2dent
Copy link

s2dent commented Feb 15, 2014

Greetings!
I'm running the my code:
main.js:

var Worker = require('webworker-threads').Worker;
var worker = new Worker('worker.js');
worker.onmessage = function (event) {
     console.log(event.data);
};
worker.postMessage('John');

worker.js:

onmessage = function(event) {
    setInterval(function(){
        postMessage('Hi, ' + event.data);
    }, 3000);
};

but the code does not work.
What am I doing wrong?
Thanks in advance for help!

@jppommet
Copy link

@s2dent see issue #13, it was mentioned before. Also look at the TODO file b704305

@s2dent
Copy link
Author

s2dent commented Feb 16, 2014

Thank you for your trouble.

@s2dent s2dent closed this as completed Feb 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants