Returns application-wide instance of
ScheduledExecutorService which is:
- Unbounded. I.e. multiple
ScheduledExecutorService.schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit)(command, 0, TimeUnit.SECONDS) will lead to multiple executions of the command in parallel.
- Backed by the application thread pool. I.e. every scheduled task will be executed in IDE's own thread pool. See
Application.executeOnPooledThread(Runnable)
- Non-shutdownable singleton. Any attempts to call
ExecutorService.shutdown(), ExecutorService.shutdownNow() will be severely punished.
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit) is disallowed because it's bad for hibernation.
Use ScheduledExecutorService.scheduleWithFixedDelay(Runnable, long, long, TimeUnit) instead.
If you need to execute only one task (when it's ready) at a time, you can use
AppExecutorUtil.createBoundedScheduledExecutorService(String, int).