Skip to content

Commit

Permalink
Merge pull request #3031 from benjchristensen/fix-flatMapIntPassthruA…
Browse files Browse the repository at this point in the history
…sync

Fix OperatorFlatMapPerf.flatMapIntPassthruAsync Perf Test
  • Loading branch information
benjchristensen committed Jun 18, 2015
2 parents 476ce0a + 0a0f6f7 commit 3cc254c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/perf/java/rx/operators/OperatorFlatMapPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import rx.Observable;
import rx.functions.Func1;
import rx.jmh.InputWithIncrementingInteger;
import rx.jmh.LatchedObserver;
import rx.schedulers.Schedulers;

@BenchmarkMode(Mode.Throughput)
Expand Down Expand Up @@ -62,14 +63,16 @@ public Observable<Integer> call(Integer i) {

@Benchmark
public void flatMapIntPassthruAsync(Input input) throws InterruptedException {
LatchedObserver<Integer> latchedObserver = input.newLatchedObserver();
input.observable.flatMap(new Func1<Integer, Observable<Integer>>() {

@Override
public Observable<Integer> call(Integer i) {
return Observable.just(i).subscribeOn(Schedulers.computation());
}

}).subscribe(input.observer);
}).subscribe(latchedObserver);
latchedObserver.latch.await();
}

@Benchmark
Expand Down

0 comments on commit 3cc254c

Please sign in to comment.