Package com.github.twitch4j.pubsub
Klasse TwitchPubSubConnectionPool
java.lang.Object
com.github.twitch4j.common.pool.AbstractConnectionPool<TwitchPubSub>
com.github.twitch4j.common.pool.SubscriptionConnectionPool<TwitchPubSub,PubSubRequest,PubSubSubscription,Boolean>
com.github.twitch4j.common.pool.TwitchModuleConnectionPool<TwitchPubSub,PubSubRequest,PubSubSubscription,Boolean,TwitchPubSubBuilder>
com.github.twitch4j.pubsub.TwitchPubSubConnectionPool
- Alle implementierten Schnittstellen:
TransactionalSubscriber<PubSubRequest,,PubSubSubscription, Boolean> ITwitchPubSub,AutoCloseable
public class TwitchPubSubConnectionPool
extends TwitchModuleConnectionPool<TwitchPubSub,PubSubRequest,PubSubSubscription,Boolean,TwitchPubSubBuilder>
implements ITwitchPubSub
A pool for PubSub connections to help navigate rate-limits.
Warning: Passing a ScheduledThreadPoolExecutor with too small corePoolSize can lead to
connections in the pool not behaving properly. Not specifying an executor allows connections to create their own
at will. If enough connections are made, this could pollute one's runtime environment.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic classTwitchPubSubConnectionPool.TwitchPubSubConnectionPoolBuilder<C extends TwitchPubSubConnectionPool,B extends TwitchPubSubConnectionPool.TwitchPubSubConnectionPoolBuilder<C, B>> Von Klasse geerbte verschachtelte Klassen/Schnittstellen com.github.twitch4j.common.pool.TwitchModuleConnectionPool
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>> Von Klasse geerbte verschachtelte Klassen/Schnittstellen 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>> Von Klasse geerbte verschachtelte Klassen/Schnittstellen com.github.twitch4j.common.pool.AbstractConnectionPool
AbstractConnectionPool.AbstractConnectionPoolBuilder<C,C2 extends AbstractConnectionPool<C>, B extends AbstractConnectionPool.AbstractConnectionPoolBuilder<C, C2, B>> -
Feldübersicht
Von Klasse geerbte Felder com.github.twitch4j.common.pool.TwitchModuleConnectionPool
advancedConfiguration, executor, proxyConfigVon Klasse geerbte Felder com.github.twitch4j.common.pool.SubscriptionConnectionPool
closed, disposeUnusedConnections, maxSubscriptionsPerConnection, saturatedConnections, subscriptions, unsaturatedConnections -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotected -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbuilder()protected TwitchPubSubprotected voiddisposeConnection(TwitchPubSub connection) longprotected PubSubRequestgetRequestFromSubscription(PubSubSubscription subscription) protected intgetSubscriptionSize(PubSubRequest pubSubRequest) protected PubSubSubscriptionhandleDuplicateSubscription(TwitchPubSub twitchPubSub, TwitchPubSub old, PubSubRequest pubSubRequest) protected PubSubSubscriptionhandleSubscription(TwitchPubSub twitchPubSub, PubSubRequest pubSubRequest) protected BooleanhandleUnsubscription(TwitchPubSub twitchPubSub, PubSubSubscription pubSubSubscription) listenOnTopic(PubSubRequest request) Send WS Message to subscribe to a topicsubscribe(PubSubRequest pubSubRequest) booleanunsubscribeFromTopic(PubSubSubscription subscription) Unsubscribe from a topic.Von Klasse geerbte Methoden com.github.twitch4j.common.pool.TwitchModuleConnectionPool
getConnectionEventManager, getDefaultConnectionEventManager, getEventManager, getExecutorVon Klasse geerbte Methoden com.github.twitch4j.common.pool.SubscriptionConnectionPool
close, getConnections, numConnections, numSubscriptions, unsubscribeVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden com.github.twitch4j.pubsub.ITwitchPubSub
close, getEventManager, listenForAdPropertyRefreshEvents, listenForAdsEvents, listenForAdsManagerEvents, listenForAutomodLevelsModificationEvents, listenForAutomodQueueEvents, listenForBitsBadgeEvents, listenForBountyBoardEvents, listenForBroadcastSettingUpdateEvents, listenForCelebrationEvents, listenForChannelBitsLeaderboardAllTimeEvents, listenForChannelBitsLeaderboardEvents, listenForChannelBitsLeaderboardEvents, listenForChannelBitsLeaderboardMonthlyEvents, listenForChannelChatroomEvents, listenForChannelDropEvents, listenForChannelExtensionEvents, listenForChannelPointsRedemptionEvents, listenForChannelPredictionsEvents, listenForChannelPrimeGiftStatusEvents, listenForChannelSquadEvents, listenForChannelSubGiftsEvents, listenForChannelSubLeaderboardAllTimeEvents, listenForChannelSubLeaderboardEvents, listenForChannelSubLeaderboardEvents, listenForChannelSubLeaderboardMonthlyEvents, listenForChannelUnbanRequestEvents, listenForCharityCampaignEvents, listenForChatHighlightEvents, listenForCheerEvents, listenForCommerceEvents, listenForCommunityBoostEvents, listenForCreatorGoalsEvents, listenForCrowdChantEvents, listenForDashboardActivityFeedEvents, listenForExtensionControlEvents, listenForFollowingEvents, listenForFriendshipEvents, listenForHypeTrainEvents, listenForHypeTrainRewardEvents, listenForLeaderboardAllTimeEvents, listenForLeaderboardEvents, listenForLeaderboardEvents, listenForLeaderboardMonthlyEvents, listenForLowTrustUsersEvents, listenForModerationEvents, listenForModerationEvents, listenForOnsiteNotificationEvents, listenForPinnedChatEvents, listenForPollEvents, listenForPresenceEvents, listenForPublicBitEvents, listenForPublicCheerEvents, listenForRadioEvents, listenForRaidEvents, listenForShieldModeEvents, listenForShoutoutEvents, listenForStreamChangeEvents, listenForStreamChatRoomEvents, listenForSubscriptionEvents, listenForUserBitsUpdateEvents, listenForUserCampaignEvents, listenForUserChannelPointsEvents, listenForUserChatroomEvents, listenForUserDropEvents, listenForUserImageUpdateEvents, listenForUserModerationNotificationEvents, listenForUserPredictionsEvents, listenForUserPropertiesUpdateEvents, listenForUserSubscribeEvents, listenForUserUnbanRequestEvents, listenForVideoPlaybackByNameEvents, listenForVideoPlaybackEvents, listenForWatchPartyEvents, listenForWhisperEvents, listenOnTopic, listenOnTopic, listenOnTopic
-
Konstruktordetails
-
TwitchPubSubConnectionPool
protected TwitchPubSubConnectionPool(TwitchPubSubConnectionPool.TwitchPubSubConnectionPoolBuilder<?, ?> b)
-
-
Methodendetails
-
listenOnTopic
Beschreibung aus Schnittstelle kopiert:ITwitchPubSubSend WS Message to subscribe to a topic- Angegeben von:
listenOnTopicin SchnittstelleITwitchPubSub- Parameter:
request- Topic- Gibt zurück:
- PubSubSubscription to be listened to
-
unsubscribeFromTopic
Beschreibung aus Schnittstelle kopiert:ITwitchPubSubUnsubscribe from a topic. Usage example:PubSubSubscription subscription = twitchPubSub.listenForCheerEvents(...); // ... twitchPubSub.unsubscribeFromTopic(subscription);- Angegeben von:
unsubscribeFromTopicin SchnittstelleITwitchPubSub- Parameter:
subscription- PubSubSubscription to be unlistened from- Gibt zurück:
- whether the subscription was previously subscribed to
-
subscribe
- Angegeben von:
subscribein SchnittstelleTransactionalSubscriber<PubSubRequest,PubSubSubscription, Boolean> - Setzt außer Kraft:
subscribein KlasseSubscriptionConnectionPool<TwitchPubSub,PubSubRequest, PubSubSubscription, Boolean>
-
createConnection
- Angegeben von:
createConnectionin KlasseAbstractConnectionPool<TwitchPubSub>
-
disposeConnection
- Angegeben von:
disposeConnectionin KlasseAbstractConnectionPool<TwitchPubSub>
-
handleSubscription
protected PubSubSubscription handleSubscription(TwitchPubSub twitchPubSub, PubSubRequest pubSubRequest) - Angegeben von:
handleSubscriptionin KlasseSubscriptionConnectionPool<TwitchPubSub,PubSubRequest, PubSubSubscription, Boolean>
-
handleDuplicateSubscription
protected PubSubSubscription handleDuplicateSubscription(TwitchPubSub twitchPubSub, TwitchPubSub old, PubSubRequest pubSubRequest) - Angegeben von:
handleDuplicateSubscriptionin KlasseSubscriptionConnectionPool<TwitchPubSub,PubSubRequest, PubSubSubscription, Boolean>
-
handleUnsubscription
protected Boolean handleUnsubscription(TwitchPubSub twitchPubSub, PubSubSubscription pubSubSubscription) - Angegeben von:
handleUnsubscriptionin KlasseSubscriptionConnectionPool<TwitchPubSub,PubSubRequest, PubSubSubscription, Boolean>
-
getRequestFromSubscription
- Angegeben von:
getRequestFromSubscriptionin KlasseSubscriptionConnectionPool<TwitchPubSub,PubSubRequest, PubSubSubscription, Boolean>
-
getSubscriptionSize
- Angegeben von:
getSubscriptionSizein KlasseSubscriptionConnectionPool<TwitchPubSub,PubSubRequest, PubSubSubscription, Boolean>
-
getLatency
public long getLatency()- Angegeben von:
getLatencyin SchnittstelleITwitchPubSub- Gibt zurück:
- the most recently measured round-trip latency for the socket(s) in milliseconds, or -1 if unknown
-
builder
-