Skip to content

Instantly share code, notes, and snippets.

@KowalczykBartek
Created January 31, 2017 16:46
Show Gist options
  • Save KowalczykBartek/ada6795d6e80d71587407d261cd7579c to your computer and use it in GitHub Desktop.
Save KowalczykBartek/ada6795d6e80d71587407d261cd7579c to your computer and use it in GitHub Desktop.
Observable.just(1, 2, 3, 4, 5)//
.map(c -> {
System.out.println("1 " + Thread.currentThread().getName());
return c;
})//
.flatMap(a -> {
return Observable.just(1) //
.observeOn(Schedulers.io())//
.map(b -> b)//
.map(c -> {
System.out.println("2 " +Thread.currentThread().getName());
return c;
});
})//
.map(c -> {
System.out.println("3 " +Thread.currentThread().getName());
return c;
}) //
.subscribe();
while (true)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment