本文整理汇总了Java中io.reactivex.internal.disposables.DisposableHelper类的典型用法代码示例。如果您正苦于以下问题:Java DisposableHelper类的具体用法?Java DisposableHelper怎么用?Java DisposableHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DisposableHelper类属于io.reactivex.internal.disposables包,在下文中一共展示了DisposableHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onError
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
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();
}
示例2: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
public void onSubscribe(Disposable d) {
if (DisposableHelper.validate(this.d, d)) {
this.d = d;
actual.onSubscribe(this);
}
}
示例3: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
public void onSubscribe(Disposable d) {
if (DisposableHelper.validate(this.upstream, d)) {
this.upstream = d;
actual.onSubscribe(this);
}
}
示例4: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@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;
}
}
示例5: onError
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
public void onError(Throwable t) {
if (s != DisposableHelper.DISPOSED) {
actual.onError(t);
} else {
RxJavaPlugins.onError(t);
}
}
示例6: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@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;
}
}
示例7: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@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;
}
}
示例8: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@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;
}
}
示例9: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
public void onSubscribe(Disposable d) {
if (DisposableHelper.validate(this.d, d)) {
this.d = d;
if (disposed) {
d.dispose();
}
}
}
示例10: onSubscribe
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
public void onSubscribe(Disposable d) {
if (DisposableHelper.validate(this.d, d)) {
this.d = d;
actual.onSubscribe(this);
}
}
示例11: onNext
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
public void onNext(T t) {
if (get() != DisposableHelper.DISPOSED) {
try {
onNext.accept(t);
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
get().dispose();
onError(e);
}
}
}
示例12: onComplete
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
public final void onComplete() {
if (get() != DisposableHelper.DISPOSED) {
lazySet(DisposableHelper.DISPOSED);
try {
onComplete.run();
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
RxJavaPlugins.onError(e);
}
}
removeSelf();
}
示例13: onSuccess
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@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);
}
}
}
示例14: subscribeActual
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@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);
}
示例15: subscribeActual
import io.reactivex.internal.disposables.DisposableHelper; //导入依赖的package包/类
@Override
protected void subscribeActual(Subscriber<? super Void> s) {
TimerSubscription parent = new TimerSubscription(s);
s.onSubscribe(parent);
DisposableHelper.replace(parent, scheduler.scheduleDirect(parent, delay, unit));
}