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

Main thread not receiving message #115

Open
morganruffner opened this issue Aug 7, 2020 · 2 comments
Open

Main thread not receiving message #115

morganruffner opened this issue Aug 7, 2020 · 2 comments

Comments

@morganruffner
Copy link

I was able to get the worker thread to receive a message, but when it then calls self.postMessage it does not seem like the main thread is receiving it. I have declared the thread with:

mettimer = new Thread('./cameraworker.js');
mettimer.onMessage = this.handleMessage;

where handleMessage is:

handleMessage = message => {
console.log('recieved message');
}

In the worker file I have:

self.onmessage = (message) => {

console.log('message received');
self.postMessage(' ');

}

Am I missing something or is this a problem with the module?

@PotrusKaterina
Copy link

I have the same. Ive found, that message can be canceled because thread is null. I deleted this *if*, but it still doesnt work(

@backmeupplz
Copy link

Try changing onMessage to onmessage

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

3 participants