somethingshould be computed only after subscription to the observable
defer: imagine you have
Observable .defer(() -> Observable.just(networkRequest()) .map() .subscribe()
networkRequest()will be executed only after subscription.
Merge, as long as the clients dont emit errors. I see there is even a
mergeDelayErrorin case you want to wait for all other clients to complete first. If bulk insert from a single client is easier than combining events from different clients, do the buffer operation before you merge.
PublishSubject<Observable<T>>, you can just call
put. Do first subscribe to the
PublishSubject.asObservable().Merge().Subscribe(...)(doesn't strictly need the asObservable if you subscribe locally). Just make sure you don't expose the Subject anywhere.