Closed ZakTaccardi closed 7 years ago
I don't have a strong opinion. I don't need this and therefore i'm not really interested in implementing it. Do you have an implementation in mind? Is a standalone delayUnsubscription(long, TimeUnit)
operator worthwhile which would eliminate the need for it to be built into this library?
delayUnsubscription(long, TimeUnit)
does indeed sound like a useful thing to have.
That is something that should be proposed to RxJava, or built as a standalone operator that can be composed with this one. I don't want to massively increase the complexity of this library with timers and scheduling for a use case that I don't have, but also for one which seems more generally applicable for standard operators like share()
.
Would this fit within the scope of this library?
Example usage:
source.replayingShare(1, TimeUnit.SECONDS)
The above
source
would only be unsubscribed from after both the following conditions are metsource
has no subscriberssource
has had no subscribers for 1 secondI could imagine this would be pretty useful for caching values such as disk loads across configuration changes.