Add a way to cancel scheduled handlers submitted to a Timer
nicktindall opened this issue · 1 comments
nicktindall commented
Currently there's no way to cancel a task submitted via Timer#schedule*
methods. ScheduledEventHandler implements closeable and is coded to throw InvalidHandlerException after it's closed but there's no way to get a reference to the handler to do that.
nicktindall commented
Note for scheduleAtFixedRate
this can be achieved by throwing an InvalidEventHandler exception from the passed VanillaEventHandler so for that case, this is just slightly improved ergonomics, but for schedule
which currently takes a runnable there is no way to cancel the task.