Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
Created January 18, 2017 22:16
Show Gist options
  • Save jwkidd3/eb6391f7ea74abec5dbab0932f9945d9 to your computer and use it in GitHub Desktop.
Save jwkidd3/eb6391f7ea74abec5dbab0932f9945d9 to your computer and use it in GitHub Desktop.
Observable<String> left =
Observable.interval(100, TimeUnit.MILLISECONDS)
.map(i -> "L" + i);
Observable<String> right =
Observable.interval(200, TimeUnit.MILLISECONDS)
.map(i -> "R" + i);
left
.join(
right,
i -> Observable.never(),
i -> Observable.timer(0, TimeUnit.MILLISECONDS),
(l,r) -> l + " - " + r
)
.take(10)
.subscribe(System.out::println);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment