Skip to content

Instantly share code, notes, and snippets.

@kvvzr
Last active May 24, 2018 09:48
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 kvvzr/e9d264adc7a1314093a418c33e838418 to your computer and use it in GitHub Desktop.
Save kvvzr/e9d264adc7a1314093a418c33e838418 to your computer and use it in GitHub Desktop.
val subject = PublishSubject.create<Int>()
// 処理が終わらない
subject
.subscribeOn(Schedulers.trampoline()) // テストコードではRxJavaPluginsによってtrampolineがsetされる
.buffer(1, TimeUnit.SECONDS)
.filter { it.isNotEmpty() }
.subscribe { buffers -> println(buffers) }
// これは大丈夫
subject
.subscribeOn(Schedulers.trampoline())
.subscribe { value -> println(value) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment