Created
April 2, 2016 12:17
-
-
Save PaulWoitaschek/80ef58d766935d0f340d9b2ce7213b31 to your computer and use it in GitHub Desktop.
Demonstrates .share() race condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable<Integer> bomb = Observable.range(1, 1000000) | |
.share(); | |
bomb.observeOn(Schedulers.io()) | |
.reduce((first, second) -> first + second) | |
.subscribe(System.out::println); | |
bomb.observeOn(Schedulers.io()) | |
.reduce((first, second) -> first + second) | |
.subscribe(System.out::println); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prints different values.