Skip to content

Instantly share code, notes, and snippets.

@NoNews
Created December 13, 2020 19:35
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 NoNews/4f1f8688bc79ebb3222ec06d6e5482c0 to your computer and use it in GitHub Desktop.
Save NoNews/4f1f8688bc79ebb3222ec06d6e5482c0 to your computer and use it in GitHub Desktop.
Observable.just("Hey")
.subscribeOn(Schedulers.io())
.map(String::length)
.subscribeOn(Schedulers.computation())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { doAction() }
.flatMap {
doAction()
Observable.timer(1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.single())
.doOnSubscribe { doAction() }
}.subscribe {
doAction()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment