Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created December 3, 2018 12:05
Show Gist options
  • Save anitaa1990/14269d7ecaa86ea3bd8193de7f6ae048 to your computer and use it in GitHub Desktop.
Save anitaa1990/14269d7ecaa86ea3bd8193de7f6ae048 to your computer and use it in GitHub Desktop.
Observable<Integer> observable = Observable.range(1, 5)
.subscribeOn(Schedulers.io());
UnicastSubject<Integer> pSubject = UnicastSubject.create();
observable.subscribe(pSubject);
pSubject.subscribe(it -> System.out.println("onNext: " + it));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment