Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
Created January 18, 2017 22:10
Show Gist options
  • Save jwkidd3/c5f3319f51b50a81c9a58fb25fed338e to your computer and use it in GitHub Desktop.
Save jwkidd3/c5f3319f51b50a81c9a58fb25fed338e to your computer and use it in GitHub Desktop.
ConnectableObservable<Long> cold = Observable.interval(200, TimeUnit.MILLISECONDS).publish();
cold.connect();
cold.subscribe(i -> System.out.println("First: " + i));
Thread.sleep(500);
cold.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