use of io.reactivex.rxjava3.internal.schedulers.IoScheduler in project RxJava by ReactiveX.
the class FlowableMergeMaxConcurrentTest method simpleAsyncLoop.
@Test
public void simpleAsyncLoop() {
IoScheduler ios = (IoScheduler) Schedulers.io();
int c = ios.size();
for (int i = 0; i < 200; i++) {
simpleAsync();
int c1 = ios.size();
if (c + 60 < c1) {
throw new AssertionError("Worker leak: " + c + " - " + c1);
}
}
}
use of io.reactivex.rxjava3.internal.schedulers.IoScheduler in project RxJava by ReactiveX.
the class CachedThreadSchedulerTest method shutdownRejects.
@Test
@SuppressUndeliverable
public void shutdownRejects() {
final int[] calls = { 0 };
Runnable r = new Runnable() {
@Override
public void run() {
calls[0]++;
}
};
IoScheduler s = new IoScheduler();
s.shutdown();
s.shutdown();
s.scheduleDirect(r);
s.scheduleDirect(r, 1, TimeUnit.SECONDS);
s.schedulePeriodicallyDirect(r, 1, 1, TimeUnit.SECONDS);
Worker w = s.createWorker();
w.dispose();
assertEquals(Disposable.disposed(), w.schedule(r));
assertEquals(Disposable.disposed(), w.schedule(r, 1, TimeUnit.SECONDS));
assertEquals(Disposable.disposed(), w.schedulePeriodically(r, 1, 1, TimeUnit.SECONDS));
assertEquals(0, calls[0]);
}
use of io.reactivex.rxjava3.internal.schedulers.IoScheduler in project RxJava by ReactiveX.
the class ObservableMergeMaxConcurrentTest method simpleAsyncLoop.
@Test
public void simpleAsyncLoop() {
IoScheduler ios = (IoScheduler) Schedulers.io();
int c = ios.size();
for (int i = 0; i < 200; i++) {
simpleAsync();
int c1 = ios.size();
if (c + 60 < c1) {
throw new AssertionError("Worker leak: " + c + " - " + c1);
}
}
}
Aggregations