Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49355

Are Web Workers a good replacement if I HAVE to poll an API?

$
0
0

@eirwin wrote:

My application uses sockets heavily for real time updates (as well as push notifications). However, in order to guarantee we have at least semi up-to-date data, I typically poll the API on a much longer interval (anywhere from 30 to 60 seconds).

Historically, I have just used $interval to do this, but it seems that is a big no-no.

Would it be worth it to attempt to run a setInterval inside of a web worker to accomplish this in a more performant way?

Additionally? Could I just run the setInterval and then notify ionic to make the call, or would I additionally need to do the work that is possible inside the web worker to make the use worth it?

What is the suggested way of accomplishing polling with a 30-60 interval if not web workers or $interval? The data I am retrieving is not large by any means, but its also not terrible small.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49355

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>