Currently, I am trying to use throttle with my observable:
observable
.throttleLatest(1000, TimeUnit.MILLISECONDS)
.subscribe { myObject ->
myObject.doA()
}
The problem here is that I want to destroy all objects of the Observable. If it's dropped, destroy it immediately. Otherwise, destroy it after the onNext callback. Is there any kind of callback to know the objects that are dropped? Something likes:
observable
.throttleLatest(1000, TimeUnit.MILLISECONDS)
.onDrop { objectThatGotDropped ->
objectThatGotDropped.destroyed()
}
.subscribe { myObject ->
myObject.afterOneSecond()
objectThatGotDropped.destroyed()
}