Package org.javacord.api.util.concurrent
Interface ThreadPool
-
public interface ThreadPoolThis class creates and contains thread pools which are used by Javacord.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScheduledExecutorServicegetDaemonScheduler()Gets the used daemon scheduler.ExecutorServicegetExecutorService()Gets the used executor service.ScheduledExecutorServicegetScheduler()Gets the used scheduler.ExecutorServicegetSingleDaemonThreadExecutorService(String threadName)Gets an executor service which only uses a single daemon thread.ExecutorServicegetSingleThreadExecutorService(String threadName)Gets an executor service which only uses a single thread.
-
-
-
Method Detail
-
getExecutorService
ExecutorService getExecutorService()
Gets the used executor service.- Returns:
- The used executor service.
-
getScheduler
ScheduledExecutorService getScheduler()
Gets the used scheduler.- Returns:
- The used scheduler.
-
getDaemonScheduler
ScheduledExecutorService getDaemonScheduler()
Gets the used daemon scheduler.- Returns:
- The used daemon scheduler.
-
getSingleThreadExecutorService
ExecutorService getSingleThreadExecutorService(String threadName)
Gets an executor service which only uses a single thread.- Parameters:
threadName- The thread name of the executor service. Will create a new one if the thread name is used the first time.- Returns:
- The executor service with the given thread name. Never
null!
-
getSingleDaemonThreadExecutorService
ExecutorService getSingleDaemonThreadExecutorService(String threadName)
Gets an executor service which only uses a single daemon thread.- Parameters:
threadName- The thread name of the executor service. Will create a new one if the thread name is used the first time.- Returns:
- The executor service with the given thread name. Never
null!
-
-