Skip to content

Instantly share code, notes, and snippets.

@aanandshekharroy
Created February 12, 2018 17:06
Show Gist options
  • Save aanandshekharroy/e3a7e83b9ee20a895634e6406d8f451f to your computer and use it in GitHub Desktop.
Save aanandshekharroy/e3a7e83b9ee20a895634e6406d8f451f to your computer and use it in GitHub Desktop.
Observable.fromArray(1,2,3)
.doOnNext {
if(it==2){
throw (RuntimeException("Exception on 2"))
}
}
.retry(3)
.subscribeBy(
onNext = {
println(it)
},onError = {
println(it.message)
},onComplete = {
println("Complete")
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment