@Override public Publisher<T> apply(Flowable<T> upstream) { return Flowable.fromPublisher(downstream -> { SubscriptionArbiter sa = new SubscriptionArbiter(); downstream.onSubscribe(sa); RetrySubscriber<T> repeatSubscriber = new RetrySubscriber<>(downstream, retry.getRetryConfig().getMaxAttempts(), sa, upstream, retry); upstream.subscribe(repeatSubscriber); }); }
@Override public SingleSource<T> apply(Single<T> upstream) { return Single.fromPublisher(downstream -> { Flowable<T> flowable = upstream.toFlowable(); SubscriptionArbiter sa = new SubscriptionArbiter(); downstream.onSubscribe(sa); RetrySubscriber<T> retrySubscriber = new RetrySubscriber<>(downstream, retry.getRetryConfig().getMaxAttempts(), sa, flowable, retry); flowable.subscribe(retrySubscriber); }); }
@Override public ObservableSource<T> apply(Observable<T> upstream) { return Observable.fromPublisher(downstream -> { Flowable<T> flowable = upstream.toFlowable(BackpressureStrategy.BUFFER); SubscriptionArbiter sa = new SubscriptionArbiter(); downstream.onSubscribe(sa); RetrySubscriber<T> retrySubscriber = new RetrySubscriber<>(downstream, retry.getRetryConfig().getMaxAttempts(), sa, flowable, retry); flowable.subscribe(retrySubscriber); }); }
@Override public Publisher<T> apply(Flowable<T> upstream) { return Flowable.fromPublisher(downstream -> { SubscriptionArbiter sa = new SubscriptionArbiter(); downstream.onSubscribe(sa); RetrySubscriber<T> repeatSubscriber = new RetrySubscriber<>(downstream, retry.getRetryConfig().getMaxAttempts(), sa, upstream, retry); upstream.subscribe(repeatSubscriber); }); }
@Override public ObservableSource<T> apply(Observable<T> upstream) { return Observable.fromPublisher(downstream -> { Flowable<T> flowable = upstream.toFlowable(BackpressureStrategy.BUFFER); SubscriptionArbiter sa = new SubscriptionArbiter(); downstream.onSubscribe(sa); RetrySubscriber<T> retrySubscriber = new RetrySubscriber<>(downstream, retry.getRetryConfig().getMaxAttempts(), sa, flowable, retry); flowable.subscribe(retrySubscriber); }); }
@Override public SingleSource<T> apply(Single<T> upstream) { return Single.fromPublisher(downstream -> { Flowable<T> flowable = upstream.toFlowable(); SubscriptionArbiter sa = new SubscriptionArbiter(); downstream.onSubscribe(sa); RetrySubscriber<T> retrySubscriber = new RetrySubscriber<>(downstream, retry.getRetryConfig().getMaxAttempts(), sa, flowable, retry); flowable.subscribe(retrySubscriber); }); }