simple-web-worker icon indicating copy to clipboard operation
simple-web-worker copied to clipboard

How to send a message from worker to main script?

Open NikitaMelikhov opened this issue 6 years ago • 1 comments

I mean somting like this in main script

worker.addEventListener("message", e => {
                console.log(e.data);
            }, false);

NikitaMelikhov avatar Feb 25 '19 17:02 NikitaMelikhov

I know the promise style return value, but this style only return 1 value at at time. if I want to receive a series of values, like post message by setInterval() in worker context. how can I receive the messages sent by worker ?

aninfeel avatar Jun 21 '19 06:06 aninfeel