Package com.slack.api.util.thread
Interface ExecutorServiceProvider
- All Known Implementing Classes:
DaemonThreadExecutorServiceProvider
public interface ExecutorServiceProvider
Provides ExecutorServices for asynchronous code executions
-
Method Summary
Modifier and TypeMethodDescriptioncreateThreadPoolExecutor
(String threadGroupName, int poolSize) Creates a new ExecutorService instance.createThreadScheduledExecutor
(String threadGroupName) Creates a new ScheduledExecutorService instance.default String
Returns the unique identifier for this instance.
-
Method Details
-
createThreadPoolExecutor
Creates a new ExecutorService instance.- Parameters:
threadGroupName
- the thread group namepoolSize
- the thread pool size- Returns:
- a new ExecutorService
-
createThreadScheduledExecutor
Creates a new ScheduledExecutorService instance.- Parameters:
threadGroupName
- the thread group name- Returns:
- a new ScheduledExecutorService
-
getInstanceId
Returns the unique identifier for this instance. The value must be unique among different implementations. The default implementation is exactly the same with the default #toString() method. The reason why we have this method is to avoid unexpected side effect in the case where a developer customizes the #toString() method behavior.- Returns:
- an instance ID
-