Package net.dv8tion.jda.api.sharding
Interface ThreadPoolProvider<T extends java.util.concurrent.ExecutorService>
-
- Type Parameters:
T
- The type of executor
public interface ThreadPoolProvider<T extends java.util.concurrent.ExecutorService>
Called byDefaultShardManager
when building a JDA instance.
Every time a JDA instance is built, the manager will first callprovide(int)
followed by a call toshouldShutdownAutomatically(int)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
provide(int shardId)
Provides an instance of the specified executor, or nulldefault boolean
shouldShutdownAutomatically(int shardId)
Whether the previously provided executor should be shutdown byJDA.shutdown()
.
-
-
-
Method Detail
-
provide
@Nullable T provide(int shardId)
Provides an instance of the specified executor, or null- Parameters:
shardId
- The current shard id- Returns:
- The Executor Service
-
shouldShutdownAutomatically
default boolean shouldShutdownAutomatically(int shardId)
Whether the previously provided executor should be shutdown byJDA.shutdown()
.- Parameters:
shardId
- The current shard id- Returns:
- True, if the executor should be shutdown by JDA
-
-