code: private <T> Observable<PollingState<T>> pollPostOrDeleteAsync(final PollingState<T> pollingState, final Type resourceType) {
          pollingState.withResourceType(resourceType);
          pollingState.withSerializerAdapter(restClient().serializerAdapter());
          return Observable.just(true)
                  .flatMap(new Func1<Boolean, Observable<PollingState<T>>>() {
                      @Override
                      public Observable<PollingState<T>> call(Boolean aBoolean) {
                          return pollPostOrDeleteSingleAsync(pollingState, resourceType).toObservable();
                      }
                  }).repeatWhen(new Func1<Observable<? extends Void>, Observable<?>>() {
                      @Override
                      public Observable<?> call(Observable<? extends Void> observable) {
                          return observable.flatMap(new Func1<Void, Observable<Long>>() {
                              @Override
                              public Observable<Long> call(Void aVoid) {
                                  return Observable.timer(pollingState.delayInMilliseconds(),
                                          TimeUnit.MILLISECONDS, Schedulers.immediate());
                              }
                          });
                      }
                  }).takeUntil(new Func1<PollingState<T>, Boolean>() {
                      @Override
                      public Boolean call(PollingState<T> tPollingState) {
                          return pollingState.isStatusTerminal();
                      }
                  });
      }
docs: Given a polling state representing state of a POST or DELETE operation, this method returns {@link Observable} object,
  when subscribed to it, a series of polling will be performed and emits each polling state to downstream.
  Polling will completes when the operation finish with success, failure or exception.
  
  @param pollingState the current polling state
  @param resourceType the java.lang.reflect.Type of the resource.
  @param <T> the type of the resource
  @return the observable of which a subscription will lead multiple polling action.