I am using the ScheduledThreadPoolExecutor to execute periodic tasks. It is essential that the execution be periodic, not with fixed delay.
I encountered the following problem: consider a period of 1 minute for a task. If the task takes 5 minutes to execute (e.g. because of a temporary network problem), the missed executions get queued up and dispatched immediately after the task finishes. Is there a way to get rid of the accumulated executions that were missed?
I tried using the remove method, but it removes the task completely, not only a specific execution.
Thanks