| Constructor and Description |
|---|
PubSubSubscriber(BalanceManager balanceManager,
redis.clients.jedis.JedisCluster jedisCluster,
String[] channels)
Create an instance of
Runnable to subscribe on the given channels. |
| Modifier and Type | Method and Description |
|---|---|
void |
onMessage(String channel,
String message)
Process the message received from the given channel.
|
void |
onSubscribe(String channel,
int subscribedChannels)
Process on subscribe successful event.
|
void |
onUnsubscribe(String channel,
int subscribedChannels)
Process on subscribe successful event.
|
void |
run()
Thread run method.
|
public PubSubSubscriber(BalanceManager balanceManager, redis.clients.jedis.JedisCluster jedisCluster, String[] channels)
Runnable to subscribe on the given channels.balanceManager - Instance of BalanceManager who will process the received messages from the
subscribed channels.jedisCluster - Connection of JedisCluster to subscribe the redis channels.channels - The redis channels to whom this PubSubSubscriber will subscribe.public void onMessage(String channel, String message)
onMessage in class redis.clients.jedis.JedisPubSubchannel - The channel, where the message is received.message - The received message.public void onSubscribe(String channel, int subscribedChannels)
onSubscribe in class redis.clients.jedis.JedisPubSubchannel - The channel, where subscription is successful.subscribedChannels - Total number of channels this JedisPubSub instance has successfully subscribed
so far.public void onUnsubscribe(String channel, int subscribedChannels)
onUnsubscribe in class redis.clients.jedis.JedisPubSubchannel - The channel, where un-subscription is successful.subscribedChannels - Total number of channels this JedisPubSub instance has successfully subscribed
so far.Copyright © 2023. All rights reserved.