问题
I want to do something after short delay:
public void notifyMe() {
Single
.timer(500, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.subscribe(ignore -> service.notifyMe()));
}
Now I have a warning: "The result of subscribe is not used"
.
How can I fix it?
回答1:
A Single will only call once. Upon calling either method, the Single terminates and the subscription to it ends.
Link can be referred for more information.
来源:https://stackoverflow.com/questions/47846275/whats-the-correct-way-to-unsubscribe-from-single