Hi, is there a way to enforce only 1 subscriber pe...
# rx
u
Hi, is there a way to enforce only 1 subscriber per cold observable? I'm looking at
subscriberOn(Schedulers.single())
but that obviously fails, when inside that chain somebody switches schedulers
m
What do you mean? Cold observables can have only 1 subscriber anyway. Consecutive subscriptions to the same cold observables result in new event streams.
You could argue that
ConnectableObservable
is also cold but it would be really strange to make an upstream connectable and allow to subscribe to it only once.
u
its a big hard to articulate. I want to allow only 1 subscriber running per all instances of a givem observable sync() : Single<Unit>
so if you subscribe sync() in 3 places, only 1st shoukd be running, others should wait