June 2015
Intermediate to advanced
182 pages
3h 56m
English
Here, we will inspect a few methods that can be used in combination with transforming operators such as flatMap or combining operators such as .zip file (more about this in the next chapter).
In order to examine their results, we will use the following method for creating subscriptions:
void subscribePrint(Observable<T> observable, String name) {
observable.subscribe(
(v) -> System.out.println(name + " : " + v),
(e) -> {
System.err.println("Error from " + name + ":");
System.err.println(e.getMessage());
},
() -> System.out.println(name + " ended!")
);
}The idea of the preceding method is to subscribe to an Observable instance and label it with a name. On OnNext, it prints the value prefixed with the name; on OnError ...
Read now
Unlock full access