And how to unit test it
Getting user’s status from server so as to “block” the bad ones, checking payment confirmation that takes 2–3 mins
Push notifications have advantages (non-blocking UX)and disadvantages (unreliability, cost e.g.SMS, can get complex quickly). There are times we really wanna do polling
It’s not just about getting data from server, sometimes we want to send server data repeatedly, as long as the app lives, or until user turn off the function e.g. send location to server in a transport app
Observable.interval(2L, TimeUnit.SECONDS, schedulerProvider.io)... will work
Observable.interval(2L, TimeUnit.SECONDS).subscribeOn(schedulerProvider.io) will not!