Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save erlangparasu/71e7cb2e8c5ede88ee375455aef64223 to your computer and use it in GitHub Desktop.

Select an option

Save erlangparasu/71e7cb2e8c5ede88ee375455aef64223 to your computer and use it in GitHub Desktop.
Observable.interval(1, TimeUnit.MICROSECONDS)
.toFlowable(BackpressureStrategy.DROP)
.observeOn(Schedulers.io(), false, 1)
.doOnNext { t ->
println(t)
try {
Thread.sleep(1000)
} catch (e: Exception) {
//
}
}
.subscribe(Consumer { myLong ->
// equals to onNext
}, Consumer { myThrowable ->
// equals to onError
}, Action {
// equals to onComplete
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment