BEAL-572 use same chedulers to be consistent

This commit is contained in:
Tomasz Lelek 2017-02-04 17:00:22 +01:00
parent c8d818c2f5
commit 3bda12d20c
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ public class ColdObservableBackPressure {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
Observable.range(1, 1_000_000) Observable.range(1, 1_000_000)
.observeOn(Schedulers.computation()) .observeOn(Schedulers.computation())
.subscribe(v -> ComputeFunction.compute(v), Throwable::printStackTrace); .subscribe(ComputeFunction::compute);
Thread.sleep(10_000); Thread.sleep(10_000);

View File

@ -18,7 +18,7 @@ public class HotObservableOnBackPressure {
Observable.range(1, 1_000_000) Observable.range(1, 1_000_000)
.onBackpressureDrop() .onBackpressureDrop()
.observeOn(Schedulers.io()) .observeOn(Schedulers.computation())
.doOnNext(ComputeFunction::compute) .doOnNext(ComputeFunction::compute)
.subscribe(v -> { .subscribe(v -> {
}, Throwable::printStackTrace); }, Throwable::printStackTrace);