Created
January 18, 2017 22:11
-
-
Save jwkidd3/c9a56f8ea764b87e3b47bfda15805dd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ConnectableObservable<Long> cold = Observable.interval(200, TimeUnit.MILLISECONDS).replay(); | |
| Subscription s = cold.connect(); | |
| System.out.println("Subscribe first"); | |
| Subscription s1 = cold.subscribe(i -> System.out.println("First: " + i)); | |
| Thread.sleep(700); | |
| System.out.println("Subscribe second"); | |
| Subscription s2 = cold.subscribe(i -> System.out.println("Second: " + i)); | |
| Thread.sleep(500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment