Background
I am just diving into the concept of RX for java. Frankly, I don't get it. In my project I use retrofit library for calling services. Currently, I have implemented all the services using callback. If I want to orchestrate service calls I have to call callbacks in callbacks which leads to quite a confusing code.
Problem
For the following two services I would like to call service B iff service A completed successfully using the Observables approach.
public interface RetrofitRestService {
@GET("...")
Observable<Object> A();
@GET("...")
Observable<Object> B();
}
I was searching for Observable operators I could use for my task but without any luck. I can imagine an operator like this:
RetrofitRestServices service;
service.A().ifSuccessfull(B());
//OR
service.A().ifWasNotEmpty(B());
//OR
service.A().useCondition(new Condition(){ ... }, B());