I'm using ScheduledExecutorService for requeuing events back into a message queue after sometime has passed. Now I need that after some event is triggered all the scheduled pending tasks of this executor are executed.
I have seen that it is possible to cancel the pending tasks, but I need to run all of them before the executor is closed. Is there a way to do this? Or should I use a different strategy to schedule this tasks.