Package net.dv8tion.jda.api.sharding
Class ThreadPoolProvider.LazySharedProvider<T extends ExecutorService>
java.lang.Object
net.dv8tion.jda.api.sharding.ThreadPoolProvider.LazySharedProvider<T>
- All Implemented Interfaces:
ThreadPoolProvider<T>
- Enclosing interface:
- ThreadPoolProvider<T extends ExecutorService>
public static final class ThreadPoolProvider.LazySharedProvider<T extends ExecutorService>
extends Object
implements ThreadPoolProvider<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.sharding.ThreadPoolProvider
ThreadPoolProvider.LazySharedProvider<T extends ExecutorService>
-
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.sharding.ThreadPoolProvider
shouldShutdownAutomatically
-
Method Details
-
init
public void init(int shardTotal) Called with the shard total to initialize the shared pool.This also destroys the temporary pool created for fetching the recommended shard total.
- Parameters:
shardTotal
- The shard total
-
shutdown
public void shutdown()Shuts down the shared pool and the temporary pool. -
provide
Provides the initialized pool or the temporary pool if not initialized yet.- Specified by:
provide
in interfaceThreadPoolProvider<T extends ExecutorService>
- Parameters:
shardId
- The current shard id- Returns:
- The thread pool instance
-