How to tear down shared, infinite Observables with a delay after the last subscriber unsubscribed
I thought this was an interesting problem and seemed a useful operator to have so I made Transformers.delayFinalUnsubscribe
in rxjava-extras:
observable
.publish()
.refCount()
.compose(Transformers
.delayFinalUnsubscribe(1, TimeUnit.MINUTES));
It's available in rxjava-extras from 0.7.9.1 on Maven Central. Give it a spin if you like and see if there are any issues.