Skip to content

Instantly share code, notes, and snippets.

@neworld
Created June 1, 2020 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neworld/648f31d9a5c6007de727cd72e2f87490 to your computer and use it in GitHub Desktop.
Save neworld/648f31d9a5c6007de727cd72e2f87490 to your computer and use it in GitHub Desktop.
@Test(timeout = 10000)
fun secondSubscription_returnsImmediate() {
val subject = PublishSubject.create<Int>()
val cachedSubject = subject.successOnlyCache()
cachedSubject.test() //first subscription
cachedSubject.test() //second subscription
//this method will never finishes if subscription is blocked.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment