Package com.github.twitch4j.common.pool
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).
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<C,X,Y,Z,B,C2 extends TwitchModuleConnectionPool<C,X,Y,Z,B>,B2 extends TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<C,X,Y,Z,B,C2,B2>>Nested classes/interfaces inherited from class com.github.twitch4j.common.pool.SubscriptionConnectionPool
SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2 extends SubscriptionConnectionPool<C,S,T,U>,B extends SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2,B>>Nested classes/interfaces inherited from class com.github.twitch4j.common.pool.AbstractConnectionPool
AbstractConnectionPool.AbstractConnectionPoolBuilder<C,C2 extends AbstractConnectionPool<C>,B extends AbstractConnectionPool.AbstractConnectionPoolBuilder<C,C2,B>> -
Field Summary
Fields Modifier and Type Field Description protected @NonNull java.util.function.Function<@NonNull B,@NonNull B>advancedConfigurationFurther configuration that should be applied to the builder when creating new connections.protected @NonNull java.util.function.Supplier<java.util.concurrent.ScheduledThreadPoolExecutor>executorTheScheduledThreadPoolExecutorto be used by connections in this pool, if specified.protected @NonNull java.util.function.Supplier<ProxyConfig>proxyConfigTheProxyConfigto be used by connections in this pool, if specified.Fields inherited from class com.github.twitch4j.common.pool.SubscriptionConnectionPool
disposeUnusedConnections, maxSubscriptionsPerConnection, saturatedConnections, subscriptions, unsaturatedConnections -
Constructor Summary
Constructors Modifier Constructor Description protectedTwitchModuleConnectionPool(TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<C,X,Y,Z,B,?,?> b) -
Method Summary
Modifier and Type Method Description protected static com.github.philippheuer.events4j.core.EventManagercreateEventManager()protected com.github.philippheuer.events4j.core.EventManagergetConnectionEventManager()protected com.github.philippheuer.events4j.core.EventManagergetDefaultConnectionEventManager()com.github.philippheuer.events4j.core.EventManagergetEventManager()The defaultEventManagerfor this connection pool, if specified.protected @NonNull java.util.concurrent.ScheduledThreadPoolExecutorgetExecutor(java.lang.String namePrefix, int poolSize)Methods inherited from class com.github.twitch4j.common.pool.SubscriptionConnectionPool
getConnections, getRequestFromSubscription, getSubscriptionSize, handleDuplicateSubscription, handleSubscription, handleUnsubscription, numConnections, numSubscriptions, subscribe, unsubscribeMethods inherited from class com.github.twitch4j.common.pool.AbstractConnectionPool
close, createConnection, disposeConnectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
executor
@NonNull protected final @NonNull java.util.function.Supplier<java.util.concurrent.ScheduledThreadPoolExecutor> executorTheScheduledThreadPoolExecutorto be used by connections in this pool, if specified. -
proxyConfig
TheProxyConfigto be used by connections in this pool, if specified. -
advancedConfiguration
@NonNull protected final @NonNull java.util.function.Function<@NonNull B,@NonNull B> advancedConfigurationFurther configuration that should be applied to the builder when creating new connections.
-
-
Constructor Details
-
TwitchModuleConnectionPool
-
-
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
EventManagerto be used in the construction of a new connection
-
getDefaultConnectionEventManager
protected com.github.philippheuer.events4j.core.EventManager getDefaultConnectionEventManager()- Returns:
- the
EventManagerto 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 defaultEventManagerfor this connection pool, if specified.
-