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> AutoCloseable
- Direct Known Subclasses:
TwitchChatConnectionPool
,TwitchPubSubConnectionPool
,TwitchSingleUserEventSocketPool
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
Modifier and TypeClassDescriptionstatic class
TwitchModuleConnectionPool.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
Modifier and TypeFieldDescriptionFurther configuration that should be applied to the builder when creating new connections.protected final @NonNull Supplier<ScheduledThreadPoolExecutor>
TheScheduledThreadPoolExecutor
to be used by connections in this pool, if specified.protected final @NonNull Supplier<ProxyConfig>
TheProxyConfig
to be used by connections in this pool, if specified.Fields inherited from class com.github.twitch4j.common.pool.SubscriptionConnectionPool
closed, disposeUnusedConnections, maxSubscriptionsPerConnection, saturatedConnections, subscriptions, unsaturatedConnections
-
Constructor Summary
ModifierConstructorDescriptionprotected
TwitchModuleConnectionPool
(TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<C, X, Y, Z, B, ?, ?> b) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.github.philippheuer.events4j.core.EventManager
protected com.github.philippheuer.events4j.core.EventManager
com.github.philippheuer.events4j.core.EventManager
The defaultEventManager
for this connection pool, if specified.protected @NonNull ScheduledThreadPoolExecutor
getExecutor
(String namePrefix, int poolSize) Methods inherited from class com.github.twitch4j.common.pool.SubscriptionConnectionPool
close, getConnections, getRequestFromSubscription, getSubscriptionSize, handleDuplicateSubscription, handleSubscription, handleUnsubscription, numConnections, numSubscriptions, subscribe, unsubscribe
Methods inherited from class com.github.twitch4j.common.pool.AbstractConnectionPool
createConnection, disposeConnection
-
Field Details
-
executor
TheScheduledThreadPoolExecutor
to be used by connections in this pool, if specified. -
proxyConfig
TheProxyConfig
to be used by connections in this pool, if specified. -
advancedConfiguration
Further configuration that should be applied to the builder when creating new connections.
-
-
Constructor Details
-
TwitchModuleConnectionPool
-
-
Method Details
-
getExecutor
@NonNull protected @NonNull ScheduledThreadPoolExecutor getExecutor(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
-
getEventManager
public com.github.philippheuer.events4j.core.EventManager getEventManager()The defaultEventManager
for this connection pool, if specified.
-