Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if a webworker is still running?

I am running a webworker from the browser.

From the parent script, I would like to check if the webworker is still running or if it is over.

like image 678
Oli Avatar asked May 09 '15 09:05

Oli


People also ask

How can you tell if a WebWorker has been terminated?

terminate() and DedicatedWorkerGlobalScope. close() in order for these to let you know about it.

How do I know if WebWorker is running?

Show activity on this post. You should have the web worker post messages about events, like when it is finished work, this way the parent can listen to these messages/events and know when work has completed. The web worker can even post progress events, this is all up to you to build though, it does not come included.

How do I close WebWorker?

terminate() The terminate() method of the Worker interface immediately terminates the Worker .


1 Answers

You should have the web worker post messages about events, like when it is finished work, this way the parent can listen to these messages/events and know when work has completed. The web worker can even post progress events, this is all up to you to build though, it does not come included.

like image 186
erikvold Avatar answered Oct 10 '22 12:10

erikvold