RXJava how to try to get next after x time
问题 I wan to do a call to a web service using retrofit every x seconds until y condition is raised. I want to run OrderApi.get after x seconds until the response is null. public class OrderApi {} public static Observable<Order> get() { //... } } OrderApi.get(order.getId())) .subscribe(updatedOrder -> { mShouldRun = updatedOrder != null; }); Already saw operators like Observable.delay Observable.timber but I cant find a way to use them properly. 回答1: this should work Observable.interval(1,