Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created August 19, 2018 09:11
Show Gist options
  • Save anitaa1990/5679f744e43a2ddda36cf7fff7a830f5 to your computer and use it in GitHub Desktop.
Save anitaa1990/5679f744e43a2ddda36cf7fff7a830f5 to your computer and use it in GitHub Desktop.
Observable.range(1, 5)
.map(i -> i * 100)
.doOnNext(i -> {
System.out.println("Emitting " + i + " on thread " + Thread.currentThread().getName());
})
.subscribeOn(Schedulers.computation())
.map(i -> i * 10)
.subscribe(i -> {
System.out.println("Received " + i + " on thread " + Thread.currentThread().getName());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment