Last active
March 24, 2019 18:15
-
-
Save baldraider/613188811e2e43ba9081646dd78aa902 to your computer and use it in GitHub Desktop.
Relay Subject Example with buffer size
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
class RelaySubjectExampleBuffer { | |
fun main(args : Array<String>){ | |
val bufferSize = 2 | |
val subject = RelaySubject<String>(bufferSize) | |
val myObserver = MyObserver() | |
subject.onNext("a") | |
subject.onNext("b") | |
subject.onNext("c") | |
subject.subscribe(myObserver) | |
subject.onNext("d") | |
subject.onComplete() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment