Package com.slack.api.util.thread
Interface ExecutorServiceProvider
-
- All Known Implementing Classes:
DaemonThreadExecutorServiceProvider
public interface ExecutorServiceProviderProvides ExecutorServices for asynchronous code executions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ExecutorServicecreateThreadPoolExecutor(String threadGroupName, int poolSize)Creates a new ExecutorService instance.ScheduledExecutorServicecreateThreadScheduledExecutor(String threadGroupName)Creates a new ScheduledExecutorService instance.default StringgetInstanceId()Returns the unique identifier for this instance.
-
-
-
Method Detail
-
createThreadPoolExecutor
ExecutorService createThreadPoolExecutor(String threadGroupName, int poolSize)
Creates a new ExecutorService instance.- Parameters:
threadGroupName- the thread group namepoolSize- the thread pool size- Returns:
- a new ExecutorService
-
createThreadScheduledExecutor
ScheduledExecutorService createThreadScheduledExecutor(String threadGroupName)
Creates a new ScheduledExecutorService instance.- Parameters:
threadGroupName- the thread group name- Returns:
- a new ScheduledExecutorService
-
getInstanceId
default String 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
-
-