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
MiSikora
06/29/2020, 2:37 PM
What do you mean? Cold observables can have only 1 subscriber anyway. Consecutive subscriptions to the same cold observables result in new event streams.
MiSikora
06/29/2020, 2:38 PM
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
ursus
06/29/2020, 4:54 PM
its a big hard to articulate. I want to allow only 1 subscriber running per all instances of a givem observable sync() : Single<Unit>
ursus
06/29/2020, 4:54 PM
so if you subscribe sync() in 3 places, only 1st shoukd be running, others should wait