-
-
Save SODA1127/add115dc883ba1d587a1921dc0129fcf 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
fun main(args: Array<String>) { | |
val connectableObservable = Observable.interval(100,TimeUnit.MILLISECONDS) | |
.publish()//1 | |
connectableObservable. | |
subscribe { println("Subscription 1: $it") }//2 | |
connectableObservable | |
.subscribe { println("Subscription 2 $it")}//3 | |
connectableObservable.connect()//4 | |
runBlocking { delay(500) }//5 | |
connectableObservable. | |
subscribe { println("Subscription 3: $it") }//6 | |
runBlocking { delay(500) }//7 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment