Java 类io.reactivex.internal.disposables.DisposableHelper 实例源码

项目:RxJava2Extensions    文件:AbstractDisposableAutoRelease.java   
public final void onError(Throwable t) {
    if (get() != DisposableHelper.DISPOSED) {
        lazySet(DisposableHelper.DISPOSED);
        if (onError != null) {
            try {
                onError.accept(t);
            } catch (Throwable e) {
                Exceptions.throwIfFatal(e);
                RxJavaPlugins.onError(new CompositeException(t, e));
            }
        } else {
            RxJavaPlugins.onError(new OnErrorNotImplementedException(t));
        }
    } else {
        RxJavaPlugins.onError(t);
    }
    removeSelf();
}
项目:RxJava2Debug    文件:CompletableOnAssembly.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Debug    文件:MaybeOnAssembly.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Debug    文件:SingleOnAssembly.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Swing    文件:SwingObserveOn.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.upstream, d)) {
        this.upstream = d;
        actual.onSubscribe(this);
    }
}
项目:DisposableAttach    文件:AttachDisposableCompletable.java   
@Override
public void onSubscribe(Disposable s) {
    if (DisposableHelper.validate(this.s, s)) {
        actual.onSubscribe(this);
        if (actual instanceof Disposable) {
            this.compositeDisposable.add((Disposable) actual);
        } else {
            this.compositeDisposable.add(this);
        }
        this.s = s;
    }
}
项目:DisposableAttach    文件:AttachDisposableCompletable.java   
@Override
public void onError(Throwable t) {
    if (s != DisposableHelper.DISPOSED) {
        actual.onError(t);
    } else {
        RxJavaPlugins.onError(t);
    }
}
项目:DisposableAttach    文件:AttachDisposableObservable.java   
@Override
public void onSubscribe(Disposable s) {
    if (DisposableHelper.validate(this.s, s)) {
        actual.onSubscribe(this);
        if(actual instanceof Disposable) {
            this.compositeDisposable.add((Disposable) actual);
        } else {
            this.compositeDisposable.add(this);
        }
        this.s = s;
    }
}
项目:DisposableAttach    文件:AttachDisposableObservable.java   
@Override
public void onError(Throwable t) {
    if (s != DisposableHelper.DISPOSED) {
        actual.onError(t);
    } else {
        RxJavaPlugins.onError(t);
    }
}
项目:DisposableAttach    文件:AttachDisposableMaybe.java   
@Override
public void onSubscribe(Disposable s) {
    if (DisposableHelper.validate(this.s, s)) {
        actual.onSubscribe(this);
        if(actual instanceof Disposable) {
            this.compositeDisposable.add((Disposable) actual);
        } else {
            this.compositeDisposable.add(this);
        }
        this.s = s;                
    }
}
项目:DisposableAttach    文件:AttachDisposableMaybe.java   
@Override
public void onError(Throwable t) {
    if (s != DisposableHelper.DISPOSED) {
        actual.onError(t);
    } else {
        RxJavaPlugins.onError(t);
    }
}
项目:DisposableAttach    文件:AttachDisposableSingle.java   
@Override
public void onSubscribe(Disposable s) {
    if (DisposableHelper.validate(this.s, s)) {
        actual.onSubscribe(this);
        if(actual instanceof Disposable) {
            this.compositeDisposable.add((Disposable) actual);
        } else {
            this.compositeDisposable.add(s);
        }
        this.s = s;                
    }
}
项目:DisposableAttach    文件:AttachDisposableSingle.java   
@Override
public void onError(Throwable t) {
    if (s != DisposableHelper.DISPOSED) {
        actual.onError(t);
    } else {
        RxJavaPlugins.onError(t);
    }
}
项目:RxJava2Jdk8Interop    文件:ZeroOneIterator.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;
        if (disposed) {
            d.dispose();
        }
    }
}
项目:RxJava2Jdk8Interop    文件:MaybeMapOptional.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:CompletableOnAssembly.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:MaybeOnAssembly.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:SingleOnAssembly.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:DisposableAutoReleaseObserver.java   
@Override
public void onNext(T t) {
    if (get() != DisposableHelper.DISPOSED) {
        try {
            onNext.accept(t);
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            get().dispose();
            onError(e);
        }
    }
}
项目:RxJava2Extensions    文件:AbstractDisposableAutoRelease.java   
public final void onComplete() {
    if (get() != DisposableHelper.DISPOSED) {
        lazySet(DisposableHelper.DISPOSED);
        try {
            onComplete.run();
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            RxJavaPlugins.onError(e);
        }
    }
    removeSelf();
}
项目:RxJava2Extensions    文件:DisposableAutoReleaseMultiObserver.java   
@Override
public void onSuccess(T t) {
    if (get() != DisposableHelper.DISPOSED) {
        lazySet(DisposableHelper.DISPOSED);
        try {
            onSuccess.accept(t);
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            RxJavaPlugins.onError(e);
        }
    }
}
项目:RxJava2Extensions    文件:NonoFromSingle.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:NonoFromObservable.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:SoloTimer.java   
@Override
protected void subscribeActual(Subscriber<? super Long> s) {
    TimerSubscriber parent = new TimerSubscriber(s);
    s.onSubscribe(parent);

    Disposable d = scheduler.scheduleDirect(parent, delay, unit);
    DisposableHelper.replace(parent.task, d);
}
项目:RxJava2Extensions    文件:PerhapsFromCompletable.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:NonoTimer.java   
@Override
protected void subscribeActual(Subscriber<? super Void> s) {
    TimerSubscription parent = new TimerSubscription(s);
    s.onSubscribe(parent);

    DisposableHelper.replace(parent, scheduler.scheduleDirect(parent, delay, unit));
}
项目:RxJava2Extensions    文件:NonoFromMaybe.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:NonoFromCompletable.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:SoloSubscribeOn.java   
@Override
protected void subscribeActual(Subscriber<? super T> s) {
    Worker worker = scheduler.createWorker();

    SubscribeOnSubscriber<T> parent = new SubscribeOnSubscriber<T>(s, worker, source);
    s.onSubscribe(parent);

    DisposableHelper.replace(parent.task, worker.schedule(parent));
}
项目:RxJava2Extensions    文件:PerhapsTimer.java   
@Override
protected void subscribeActual(Subscriber<? super Long> s) {
    TimerSubscriber parent = new TimerSubscriber(s);
    s.onSubscribe(parent);

    Disposable d = scheduler.scheduleDirect(parent, delay, unit);
    DisposableHelper.replace(parent.task, d);
}
项目:RxJava2Extensions    文件:SoloFromSingle.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:PerhapsFromMaybe.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:RxJava2Extensions    文件:PerhapsSubscribeOn.java   
@Override
protected void subscribeActual(Subscriber<? super T> s) {
    Worker worker = scheduler.createWorker();

    SubscribeOnSubscriber<T> parent = new SubscribeOnSubscriber<T>(s, worker, source);
    s.onSubscribe(parent);

    DisposableHelper.replace(parent.task, worker.schedule(parent));
}
项目:akarnokd-misc    文件:SingleFlatMapIterableFlowable.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:akarnokd-misc    文件:SingleFlatMapIterableObservable.java   
@Override
public void onSubscribe(Disposable d) {
    if (DisposableHelper.validate(this.d, d)) {
        this.d = d;

        actual.onSubscribe(this);
    }
}
项目:resilience4j    文件:DisposableCircuitBreaker.java   
protected final void onSubscribeWithPermit(Disposable disposable) {
    if (DisposableHelper.setOnce(this, disposable)) {
        if (acquireCallPermit()) {
            onSubscribeInner(this);
        } else {
            dispose();
            onSubscribeInner(this);
            permittedOnError(circuitBreakerOpenException());
        }
    }
}
项目:resilience4j    文件:DisposableBulkhead.java   
protected final void onSubscribeWithPermit(Disposable disposable) {
    if (DisposableHelper.setOnce(this, disposable)) {
        if (acquireCallPermit()) {
            onSubscribeInner(this);
        } else {
            dispose();
            onSubscribeInner(this);
            permittedOnError(bulkheadFullException());
        }
    }
}
项目:DisposableAttach    文件:AttachDisposableObservable.java   
@Override
public void onComplete() {
    if (s != DisposableHelper.DISPOSED) {
        actual.onComplete();
    }
}
项目:RxJava2Extensions    文件:JoinObserver1.java   
@Override
public boolean isDisposed() {
    return DisposableHelper.isDisposed(safeObserver.get());
}
项目:RxJava2Extensions    文件:JoinObserver1.java   
@Override
public void dispose() {
    DisposableHelper.dispose(safeObserver);
}