Skip to content

Instantly share code, notes, and snippets.

@jshvarts
Last active October 13, 2019 19:50
Show Gist options
  • Save jshvarts/c83d9fe729a8553f77cd186486cfb38a to your computer and use it in GitHub Desktop.
Save jshvarts/c83d9fe729a8553f77cd186486cfb38a to your computer and use it in GitHub Desktop.
Basic subscribeOn and observeOn case
Observable.just("long", "longer", "longest")
.subscribeOn(Schedulers.io())
.map(String::length)
.observeOn(Schedulers.computation())
.filter { it > 6 }
.subscribe { length -> println("item length $length") }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment