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(); }
@Override public void onSubscribe(Disposable d) { if (DisposableHelper.validate(this.d, d)) { this.d = d; actual.onSubscribe(this); } }
@Override public void onSubscribe(Disposable d) { if (DisposableHelper.validate(this.upstream, d)) { this.upstream = d; actual.onSubscribe(this); } }
@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; } }
@Override public void onError(Throwable t) { if (s != DisposableHelper.DISPOSED) { actual.onError(t); } else { RxJavaPlugins.onError(t); } }
@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; } }
@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; } }
@Override public void onSubscribe(Disposable d) { if (DisposableHelper.validate(this.d, d)) { this.d = d; if (disposed) { d.dispose(); } } }
@Override public void onNext(T t) { if (get() != DisposableHelper.DISPOSED) { try { onNext.accept(t); } catch (Throwable e) { Exceptions.throwIfFatal(e); get().dispose(); onError(e); } } }
public final void onComplete() { if (get() != DisposableHelper.DISPOSED) { lazySet(DisposableHelper.DISPOSED); try { onComplete.run(); } catch (Throwable e) { Exceptions.throwIfFatal(e); RxJavaPlugins.onError(e); } } removeSelf(); }
@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); } } }
@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); }
@Override protected void subscribeActual(Subscriber<? super Void> s) { TimerSubscription parent = new TimerSubscription(s); s.onSubscribe(parent); DisposableHelper.replace(parent, scheduler.scheduleDirect(parent, delay, unit)); }
@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)); }
protected final void onSubscribeWithPermit(Disposable disposable) { if (DisposableHelper.setOnce(this, disposable)) { if (acquireCallPermit()) { onSubscribeInner(this); } else { dispose(); onSubscribeInner(this); permittedOnError(circuitBreakerOpenException()); } } }
protected final void onSubscribeWithPermit(Disposable disposable) { if (DisposableHelper.setOnce(this, disposable)) { if (acquireCallPermit()) { onSubscribeInner(this); } else { dispose(); onSubscribeInner(this); permittedOnError(bulkheadFullException()); } } }
@Override public void onComplete() { if (s != DisposableHelper.DISPOSED) { actual.onComplete(); } }
@Override public boolean isDisposed() { return DisposableHelper.isDisposed(safeObserver.get()); }
@Override public void dispose() { DisposableHelper.dispose(safeObserver); }