Created
November 17, 2018 16:00
-
-
Save rohmanhakim/5c2eda205b3f501ee9ebf5fe63ebf07a to your computer and use it in GitHub Desktop.
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
val observable = Observable.just("some event") | |
.map { | |
Thread.sleep(randomInt()) | |
System.currentTimeMillis() | |
} | |
.publish() | |
.autoConnect(2) | |
val sub1 = observable.subscribe({ println("sub1 got : $it") },{}) | |
val sub2 = observable.subscribe({ println("sub2 got : $it") },{}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment