Reputation: 606
I have a ConnectableObservable
and multiple subscribers. And subscriptions are happen in different threads by using subscribeOn
operator.
Problem is that I want to call connect
operator when all subscriptions are done because I don't want any subscribers miss any packets.
But I cannot make sure if all subscribers have subscribed the observable because it happens on different threads.
Also I don't want to use replay
operator. There is no reason to cache all packets just because of async subscriptions.
Upvotes: 1
Views: 53
Reputation: 69997
If you know the exact number of Subscriber
s and the only action you want is to connect when all of them are ready then use autoConnect(int)
.
Upvotes: 0