Created
August 19, 2018 08:41
-
-
Save anitaa1990/e405b024c20a54bc55d2e3f2244c663e to your computer and use it in GitHub Desktop.
This file contains 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
Observable.just("A", "B", "C", "D", "E", "F") | |
.materialize() | |
.subscribe(new Observer<Notification<String>>() { | |
@Override | |
public void onSubscribe(Disposable d) { | |
} | |
@Override | |
public void onNext(Notification<String> stringNotification) { | |
/* | |
* From the notification object, we can check if the | |
* emitted item is: | |
* isOnNext() or isOnError() or isOnComplete() | |
* | |
* Here we can basically fetch items that are successful | |
* & omit items that resulted in error. | |
* | |
* */ | |
System.out.println(stringNotification.getValue()); | |
} | |
@Override | |
public void onError(Throwable e) { | |
} | |
@Override | |
public void onComplete() { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment