Interface ThreadPoolProvider<T extends ExecutorService>

Type Parameters:
T - The type of executor

public interface ThreadPoolProvider<T extends ExecutorService>
Called by DefaultShardManager when building a JDA instance.
Every time a JDA instance is built, the manager will first call provide(int) followed by a call to shouldShutdownAutomatically(int).
  • Method Summary

    Modifier and Type
    Method
    Description
    provide(int shardId)
    Provides an instance of the specified executor, or null
    default boolean
    Whether the previously provided executor should be shutdown by JDA.shutdown().
  • Method Details

    • 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 by JDA.shutdown().
      Parameters:
      shardId - The current shard id
      Returns:
      True, if the executor should be shutdown by JDA