Search in sources :

Example 6 with Disposable

use of io.reactivex.disposables.Disposable in project RxJava by ReactiveX.

the class FutureSingleObserver method onError.

@Override
public void onError(Throwable t) {
    for (; ; ) {
        Disposable a = s.get();
        if (a == DisposableHelper.DISPOSED) {
            RxJavaPlugins.onError(t);
            return;
        }
        error = t;
        if (s.compareAndSet(a, this)) {
            countDown();
            return;
        }
    }
}
Also used : Disposable(io.reactivex.disposables.Disposable)

Example 7 with Disposable

use of io.reactivex.disposables.Disposable in project RxJava by ReactiveX.

the class FutureSingleObserver method onSuccess.

@Override
public void onSuccess(T t) {
    Disposable a = s.get();
    if (a == DisposableHelper.DISPOSED) {
        return;
    }
    value = t;
    s.compareAndSet(a, this);
    countDown();
}
Also used : Disposable(io.reactivex.disposables.Disposable)

Example 8 with Disposable

use of io.reactivex.disposables.Disposable in project RxJava by ReactiveX.

the class FlowableTimer method subscribeActual.

@Override
public void subscribeActual(Subscriber<? super Long> s) {
    TimerSubscriber ios = new TimerSubscriber(s);
    s.onSubscribe(ios);
    Disposable d = scheduler.scheduleDirect(ios, delay, unit);
    ios.setResource(d);
}
Also used : Disposable(io.reactivex.disposables.Disposable)

Example 9 with Disposable

use of io.reactivex.disposables.Disposable in project RxJava by ReactiveX.

the class ObservableInterval method subscribeActual.

@Override
public void subscribeActual(Observer<? super Long> s) {
    IntervalObserver is = new IntervalObserver(s);
    s.onSubscribe(is);
    Disposable d = scheduler.schedulePeriodicallyDirect(is, initialDelay, period, unit);
    is.setResource(d);
}
Also used : Disposable(io.reactivex.disposables.Disposable)

Example 10 with Disposable

use of io.reactivex.disposables.Disposable in project RxJava by ReactiveX.

the class ObservableIntervalRange method subscribeActual.

@Override
public void subscribeActual(Observer<? super Long> s) {
    IntervalRangeObserver is = new IntervalRangeObserver(s, start, end);
    s.onSubscribe(is);
    Disposable d = scheduler.schedulePeriodicallyDirect(is, initialDelay, period, unit);
    is.setResource(d);
}
Also used : Disposable(io.reactivex.disposables.Disposable)

Aggregations

Disposable (io.reactivex.disposables.Disposable)199 Test (org.junit.Test)95 Logger (chat.rocket.android.helper.Logger)19 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)18 CompositeDisposable (io.reactivex.disposables.CompositeDisposable)17 Worker (io.reactivex.Scheduler.Worker)15 AndroidSchedulers (io.reactivex.android.schedulers.AndroidSchedulers)13 CountingRunnable (io.reactivex.android.testutil.CountingRunnable)10 EmptyDisposable (io.reactivex.internal.disposables.EmptyDisposable)10 TestSubscriber (io.reactivex.subscribers.TestSubscriber)10 Optional (com.fernandocejas.arrow.optional.Optional)9 Single (io.reactivex.Single)9 Nullable (android.support.annotation.Nullable)8 Function (io.reactivex.functions.Function)8 Bundle (android.os.Bundle)7 Pair (android.support.v4.util.Pair)7 ANError (com.androidnetworking.error.ANError)7 AnalyticsListener (com.androidnetworking.interfaces.AnalyticsListener)7 List (java.util.List)7 NonNull (android.support.annotation.NonNull)6