The SimpleThreadPool class shipped along with Quartz Scheduler does not have a FIFO behavior. I want to make sure if I keep adding jobs to the scheduler, they are addressed in a First – in – First – out basis. Is there any ThreadPool available for this ? Or is there any other way to achieve this?
The SimpleThreadPool class shipped along with Quartz Scheduler does not have a FIFO behavior.
Share
You could achieve this by delegating to a ThreadPoolExecutor with a FIFO queue, as follows :
It is possible that the active count of executables will not exactly match the exact number of tasks that are executing. You’d need to add a latch and use the beforeExecute to ensure
that the task has started running if this is necessary.