Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
Created January 18, 2017 22:12
Show Gist options
  • Save jwkidd3/6d95c488b35f28044cc4bc5dbd985578 to your computer and use it in GitHub Desktop.
Save jwkidd3/6d95c488b35f28044cc4bc5dbd985578 to your computer and use it in GitHub Desktop.
Observable<Long> obs = Observable.interval(100, TimeUnit.MILLISECONDS)
.take(5)
.cache();
Thread.sleep(500);
obs.subscribe(i -> System.out.println("First: " + i));
Thread.sleep(300);
obs.subscribe(i -> System.out.println("Second: " + i));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment