Package com.github.twitch4j.common.pool
Class SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2 extends SubscriptionConnectionPool<C,S,T,U>,B extends SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2,B>>
java.lang.Object
com.github.twitch4j.common.pool.AbstractConnectionPool.AbstractConnectionPoolBuilder<C,C2,B>
com.github.twitch4j.common.pool.SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2,B>
- Direct Known Subclasses:
TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder
- Enclosing class:
- SubscriptionConnectionPool<C,
S, T, U>
public abstract static class SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2 extends SubscriptionConnectionPool<C,S,T,U>,B extends SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,S,T,U,C2,B>>
extends AbstractConnectionPool.AbstractConnectionPoolBuilder<C,C2,B>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract C2
build()
disposeUnusedConnections
(boolean disposeUnusedConnections) Whether connections without subscriptions should be disposed of.maxSubscriptionsPerConnection
(int maxSubscriptionsPerConnection) The maximum number of outstanding subscriptions a connection may have.protected abstract B
self()
toString()
-
Constructor Details
-
SubscriptionConnectionPoolBuilder
public SubscriptionConnectionPoolBuilder()
-
-
Method Details
-
disposeUnusedConnections
Whether connections without subscriptions should be disposed of. Default: true.As an optimization, this can be set to false to not dispose of connections in an environment where it is known that a large burst of unsubscriptions will be followed by enough subscriptions such that connections will never need to be disposed of automatically. However, be wary of configuring this as a misstep in your calculations may lead to connections sitting idly while consuming resources.
- Returns:
this
.
-
maxSubscriptionsPerConnection
The maximum number of outstanding subscriptions a connection may have. Default: 50.50 is a reasonable default given that it is the standard limit imposed on PubSub connections by Twitch and it is the previously-documented rate-limit on the number of possible JOINs in chat in a short burst.
- Returns:
this
.- See Also:
-
self
-
build
-
toString
-