Class TwitchModuleConnectionPool<C,​X,​Y,​Z,​B>

java.lang.Object
com.github.twitch4j.common.pool.AbstractConnectionPool<C>
com.github.twitch4j.common.pool.SubscriptionConnectionPool<C,​X,​Y,​Z>
com.github.twitch4j.common.pool.TwitchModuleConnectionPool<C,​X,​Y,​Z,​B>
Type Parameters:
B - the builder of the connection
All Implemented Interfaces:
TransactionalSubscriber<X,​Y,​Z>, java.lang.AutoCloseable

public abstract class TwitchModuleConnectionPool<C,​X,​Y,​Z,​B>
extends SubscriptionConnectionPool<C,​X,​Y,​Z>
Adds common configuration options for subscription-based connection pools built around instances of T4J modules.

A pool of connections for making subscriptions (and potentially unsubscribing from later).

  • Field Details

    • executor

      @NonNull protected final @NonNull java.util.function.Supplier<java.util.concurrent.ScheduledThreadPoolExecutor> executor
      The ScheduledThreadPoolExecutor to be used by connections in this pool, if specified.
    • proxyConfig

      @NonNull protected final @NonNull java.util.function.Supplier<ProxyConfig> proxyConfig
      The ProxyConfig to be used by connections in this pool, if specified.
    • advancedConfiguration

      @NonNull protected final @NonNull java.util.function.Function<@NonNull B,​@NonNull B> advancedConfiguration
      Further configuration that should be applied to the builder when creating new connections.
  • Constructor Details

  • Method Details

    • getExecutor

      @NonNull protected @NonNull java.util.concurrent.ScheduledThreadPoolExecutor getExecutor​(java.lang.String namePrefix, int poolSize)
    • getConnectionEventManager

      protected com.github.philippheuer.events4j.core.EventManager getConnectionEventManager()
      Returns:
      a EventManager to be used in the construction of a new connection
    • getDefaultConnectionEventManager

      protected com.github.philippheuer.events4j.core.EventManager getDefaultConnectionEventManager()
      Returns:
      the EventManager to use if none was specified by the user for the connection-level
    • createEventManager

      protected static com.github.philippheuer.events4j.core.EventManager createEventManager()
    • getEventManager

      public com.github.philippheuer.events4j.core.EventManager getEventManager()
      The default EventManager for this connection pool, if specified.