use of io.reactivex.rxjava3.internal.disposables.SequentialDisposable in project RxJava by ReactiveX.
the class ObservableRepeatUntil method subscribeActual.
@Override
public void subscribeActual(Observer<? super T> observer) {
SequentialDisposable sd = new SequentialDisposable();
observer.onSubscribe(sd);
RepeatUntilObserver<T> rs = new RepeatUntilObserver<>(observer, until, sd, source);
rs.subscribeNext();
}
use of io.reactivex.rxjava3.internal.disposables.SequentialDisposable in project RxJava by ReactiveX.
the class ObservableRetryBiPredicate method subscribeActual.
@Override
public void subscribeActual(Observer<? super T> observer) {
SequentialDisposable sa = new SequentialDisposable();
observer.onSubscribe(sa);
RetryBiObserver<T> rs = new RetryBiObserver<>(observer, predicate, sa, source);
rs.subscribeNext();
}
use of io.reactivex.rxjava3.internal.disposables.SequentialDisposable in project RxJava by ReactiveX.
the class ObservableDelaySubscriptionOther method subscribeActual.
@Override
public void subscribeActual(final Observer<? super T> child) {
final SequentialDisposable serial = new SequentialDisposable();
child.onSubscribe(serial);
Observer<U> otherObserver = new DelayObserver(serial, child);
other.subscribe(otherObserver);
}
use of io.reactivex.rxjava3.internal.disposables.SequentialDisposable in project RxJava by ReactiveX.
the class SingleDelay method subscribeActual.
@Override
protected void subscribeActual(final SingleObserver<? super T> observer) {
final SequentialDisposable sd = new SequentialDisposable();
observer.onSubscribe(sd);
source.subscribe(new Delay(sd, observer));
}
use of io.reactivex.rxjava3.internal.disposables.SequentialDisposable in project RxJava by ReactiveX.
the class AbstractSchedulerTests method schedulePeriodicallyZeroPeriod.
@Test
public void schedulePeriodicallyZeroPeriod() throws Exception {
Scheduler s = getScheduler();
if (s instanceof TrampolineScheduler) {
// can't properly stop a trampolined periodic task
return;
}
for (int initial = 0; initial < 2; initial++) {
final CountDownLatch cdl = new CountDownLatch(1);
final SequentialDisposable sd = new SequentialDisposable();
Scheduler.Worker w = s.createWorker();
try {
sd.replace(w.schedulePeriodically(new Runnable() {
int count;
@Override
public void run() {
if (++count == 10) {
sd.dispose();
cdl.countDown();
}
}
}, initial, 0, TimeUnit.MILLISECONDS));
assertTrue("" + initial, cdl.await(5, TimeUnit.SECONDS));
} finally {
sd.dispose();
w.dispose();
}
}
}
Aggregations