Package com.intellij.util.concurrency
Class AppExecutorUtil
java.lang.Object
com.intellij.util.concurrency.AppExecutorUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServiceApplication tread pool.static ScheduledExecutorServiceReturns application-wide instance ofScheduledExecutorServicewhich is: Unbounded.
-
Constructor Details
-
AppExecutorUtil
public AppExecutorUtil()
-
-
Method Details
-
getAppScheduledExecutorService
Returns application-wide instance ofScheduledExecutorServicewhich 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 thecommandin parallel. - Backed by the application thread pool. I.e. every scheduled task will be executed in IDEA own thread pool. See
invalid reference
com.intellij.openapi.application.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. UseScheduledExecutorService.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)instead.
- Unbounded. I.e. multiple
-
getAppExecutorService
Application tread pool. This pool is- Unbounded.
- Application-wide, always active, non-shutdownable singleton.
-