Yes, this may seem a little ambitious, but here is what I want to achieve:
I have a class that contains my hot Observable, it takes some time to prepare it to prepare it correctly (create it elsewhere and get the link), so when another class requests it, the link may remain empty (calls NullPointer). What I'm trying to achieve is similar to the NullObject pattern: it returns an empty observable (instead of zero) that can be safely signed, and when the Observable is created correctly, start issuing the elements.
The only way to solve this is to create PublishSubjectone that acts as a bridge between the client classes and the ObservableHolder class. The PublishSubject link is always returned to the client, and when Observableready, it simply redirects all events to the object. This is a good decision? Or can it be done better?
@edit
I decided to stay with my decision, I think that after packing it in class it is a good enough solution. I supported the answer below, however, it does not correspond to my problem, because it is not directly related to the implementation rx-java, however, the suggestion about the proxy server template was useful.
source
share