Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, those are abstraction over a TCP socket and introduce more complexity than you'd need for something like this. There's nothing wrong with occasionally polling for updates.


Web push, FCM, APNS, etc are free because they only have a single systemwide TCP channel open - and that channel is already open whether or not your app chooses to use it.

Your app can also be ready to receive notifications even when the app isn't running - using zero RAM. Inetd on Linux allows similar stuff (although no ability to handle ip changes or traverse NAT makes it fairly useless in the consumer world).

This stuff is important because polling dominates power use when idle - especially network polling which generally requires hundreds of milliseconds of system awakeness to handle tens of network packet arrivals simply for a basic http request.

Did you know, a typical android phone, if all polling is disabled, has a battery life of 45 days?


An android phone on airplane mode has a battery life of 45 days?


Airplane mode and the scheduler disabled, yes (ie. So Apps don't wake up every 5 mins and attempt to contact the network).

It's actually required by the qualification process for lots of carriers. The built in apps have pretty much no polling for this reason.

During the qualification test, it's actually connected to both LTE and WiFi, but not actually transferring any data.

They cheat a little - the phone is not signed into a Google account, which makes pretty much all Google apps go idle.


How does a user disable the scheduler?


That's quite oem specific, but usually 'battery saver' does it.


That's a lot of abstraction to implement a simple update check and I suspect it's very much not worth it to save a minuscule amount of battery life on a laptop. This is ignoring that you're incorrect about how Web Push works, so you'd need that extra TCP connection anyway and at that point, there's no point in bothering with Web Push. FCM is the same deal (and now you get to pay for extra stuff for a trivial problem, woo) and APN seems like the wrong solution to auto-updates.

Just poll every launch or 24 hours and move on.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: