Right now I\'m implementing some polling logic with RxJava. I\'m supposed to poll an endpoint a number of times until it tells me to stop. Additionally, each response come
service.endpoint() .flatMap((Function, SingleSource>>) response -> Single.just(response).delaySubscription(getDelayFromResponce(response), TimeUnit.MILLISECONDS)) .repeat() .subscribe();