BAEL-572 move code to tests
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
package com.baelding.rxjava;
|
||||
|
||||
import rx.Observable;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
public class ColdObservableBackpressure {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
|
||||
Observable.range(1, 1_000_000)
|
||||
.observeOn(Schedulers.computation())
|
||||
.subscribe(ComputeFunction::compute);
|
||||
|
||||
Thread.sleep(10_000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.baelding.rxjava;
|
||||
|
||||
import rx.schedulers.Schedulers;
|
||||
import rx.subjects.PublishSubject;
|
||||
|
||||
public class HotObservableBackpressureBatching {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
PublishSubject<Integer> source = PublishSubject.<Integer>create();
|
||||
|
||||
source.window(500).observeOn(Schedulers.computation()).subscribe(ComputeFunction::compute, Throwable::printStackTrace);
|
||||
|
||||
for (int i = 0; i < 1_000_000; i++) {
|
||||
source.onNext(i);
|
||||
}
|
||||
Thread.sleep(10_000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.baelding.rxjava;
|
||||
|
||||
import rx.schedulers.Schedulers;
|
||||
import rx.subjects.PublishSubject;
|
||||
|
||||
public class HotObservableBackpressureBuffering {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
PublishSubject<Integer> source = PublishSubject.<Integer>create();
|
||||
|
||||
source.buffer(1024).observeOn(Schedulers.computation()).subscribe(ComputeFunction::compute, Throwable::printStackTrace);
|
||||
|
||||
for (int i = 0; i < 1_000_000; i++) {
|
||||
source.onNext(i);
|
||||
}
|
||||
Thread.sleep(10_000);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.baelding.rxjava;
|
||||
|
||||
import rx.schedulers.Schedulers;
|
||||
import rx.subjects.PublishSubject;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class HotObservableBackpressureSkipping {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
PublishSubject<Integer> source = PublishSubject.<Integer>create();
|
||||
|
||||
source.sample(100, TimeUnit.MILLISECONDS)
|
||||
// .throttleFirst(100, TimeUnit.MILLISECONDS)
|
||||
.observeOn(Schedulers.computation()).subscribe(ComputeFunction::compute, Throwable::printStackTrace);
|
||||
|
||||
for (int i = 0; i < 1_000_000; i++) {
|
||||
source.onNext(i);
|
||||
}
|
||||
Thread.sleep(10_000);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.baelding.rxjava;
|
||||
|
||||
|
||||
import rx.schedulers.Schedulers;
|
||||
import rx.subjects.PublishSubject;
|
||||
|
||||
public class HotObservableWithoutBackpressure {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
PublishSubject<Integer> source = PublishSubject.<Integer>create();
|
||||
|
||||
source.observeOn(Schedulers.computation())
|
||||
.subscribe(ComputeFunction::compute, Throwable::printStackTrace);
|
||||
|
||||
|
||||
for (int i = 0; i < 1_000_000; i++) {
|
||||
source.onNext(i);
|
||||
}
|
||||
Thread.sleep(10_000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user