Re:Limiting JavaScript?
by int_19h on Sunday February 03, 2019 @03:11AM
(#19068401)
On mobile platforms, app don't use polling loops for that sort of stuff, precisely so that power usage could be optimized. Time for something similar for the web?
[ Parent
| on HN ]
Arent notifications same thing with only difference that they go through apple/google centralized server so your phone doesnt have to listen for multiple servers but just one?
A simple short-term workaround would a setInterval equivalent that can be set to "every so often" instead of a hard number, leaving it up to the browser or OS to coalesce updates into chunks of activity every so often.
background connections !== polling loops
Many services use an open tcp connection (e.g. websocket) rather than polling. Mobile platforms are doing the same thing, just on a system level. I guess service workers are the closest web analogue.