I have an API available to clients that can be simplified to this:
public class API {
public void sendEvent(Event e);
}
Event
instances enter my system whenever a client calls the API (technically over Binder into a Service
derivative) which are then processed, filtered and dispatched to other internal components. I don't care about past events, just those available from the time a subscriber subscribes. It seems like a natural fit for the Rx paradigm which I'm just getting my feet wet with.
I need an Observable that is created once, allows multiple subscribers, and can be fed instances of Event
that are then sent through the reactive pipeline to observers. A Subject
seems appropriate for what I'm looking to do (in particular, this answer to this question resonated with me).
What do other RxJava users recommend?