RxJava: How to multicast a Completable?
问题 I have a method which returns a Completable and I want it to be multicasted because any second subscriber should not re-execute the method, instead they should get the same old emitted values. I achieved it using replay().autoConnect() as follows and working as expected public Completable init() { return repository.init() .subscribeOn(Schedulers.io()) .flatMapCompletable(s -> Completable.fromAction(() -> { // some action })).toObservable().replay().autoConnect().ignoreElements(); } As you see