public class RedisPubSubProvider.Dispatcher extends redis.clients.jedis.JedisPubSub
#run
must be
called in a new thread.Modifier and Type | Field and Description |
---|---|
protected String |
pattern |
protected RedisExecutor |
redisExecutor |
protected boolean |
stop |
protected CountDownLatch |
subscribedLatch |
Constructor and Description |
---|
Dispatcher(String pattern) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitSubscribed(long timeout,
TimeUnit unit)
To be called from the main thread to wait for subscription to be effective.
|
void |
close()
To be called from the main thread to stop the subscription.
|
protected void |
flush(redis.clients.jedis.Client client) |
void |
onMessage(String channel,
byte[] message) |
void |
onPMessage(String pattern,
String channel,
byte[] message) |
void |
onPSubscribe(String pattern,
int subscribedChannels) |
void |
proceed(redis.clients.jedis.Client client,
String... channels) |
void |
proceedWithPatterns(redis.clients.jedis.Client client,
String... patterns) |
protected void |
processBinary(redis.clients.jedis.Client client) |
void |
run()
To be called from a new thread to do the actual Redis subscription and to dispatch messages.
|
protected String |
toString(byte[] bytes) |
protected RedisExecutor redisExecutor
protected final CountDownLatch subscribedLatch
protected volatile boolean stop
public Dispatcher(String pattern)
public boolean awaitSubscribed(long timeout, TimeUnit unit)
public void run()
public void close()
public void onPSubscribe(String pattern, int subscribedChannels)
onPSubscribe
in class redis.clients.jedis.JedisPubSub
public void onPMessage(String pattern, String channel, byte[] message)
public void proceed(redis.clients.jedis.Client client, String... channels)
proceed
in class redis.clients.jedis.JedisPubSub
public void proceedWithPatterns(redis.clients.jedis.Client client, String... patterns)
proceedWithPatterns
in class redis.clients.jedis.JedisPubSub
protected void flush(redis.clients.jedis.Client client)
protected void processBinary(redis.clients.jedis.Client client)
Copyright © 2018 Nuxeo. All rights reserved.