Are Web Workers Safe For Ionic?


#1

I have some functionality that needs to guarantee messages that I am using sockets to update the UI.

In the event sockets fail, I want to fallback to polling just to make sure I am retrieving the items from my API.

During testing, I have (embarrassingly) used $interval but know this is not sustainable, so I am looking into web workers.

If I am using Crosswalk and the updates iOS browser (not sure if there even is one at this point), is it safe for me to implement web workers to run this polling? I am aware that I can’t access many things in the web workers, but I would just need to pass data back to ionic context so that it can be handled accordingly.


#2

Webworkers should be fine, if you look into the support,
http://caniuse.com/#search=web%20worker

It looks like it is supported well enough, I have used webworkers in Android before, although never got to test them on iOS.