Fixed - status listener should be invoked only for channel it added

pull/860/head
Nikita 8 years ago
parent 0f2a3c6ffc
commit 0a876bd5fa

@ -75,12 +75,15 @@ public class PubSubPatternStatusListener<V> implements RedisPubSubListener<V> {
@Override @Override
public boolean onStatus(PubSubType type, String channel) { public boolean onStatus(PubSubType type, String channel) {
if (type == PubSubType.PSUBSCRIBE) { if (channel.equals(name)) {
listener.onPSubscribe(channel); if (type == PubSubType.PSUBSCRIBE) {
} else if (type == PubSubType.PUNSUBSCRIBE) { listener.onPSubscribe(channel);
listener.onPUnsubscribe(channel); } else if (type == PubSubType.PUNSUBSCRIBE) {
listener.onPUnsubscribe(channel);
}
return true;
} }
return true; return false;
} }
} }

@ -75,12 +75,15 @@ public class PubSubStatusListener<V> implements RedisPubSubListener<V> {
@Override @Override
public boolean onStatus(PubSubType type, String channel) { public boolean onStatus(PubSubType type, String channel) {
if (type == PubSubType.SUBSCRIBE) { if (channel.equals(name)) {
listener.onSubscribe(channel); if (type == PubSubType.SUBSCRIBE) {
} else if (type == PubSubType.UNSUBSCRIBE) { listener.onSubscribe(channel);
listener.onUnsubscribe(channel); } else if (type == PubSubType.UNSUBSCRIBE) {
listener.onUnsubscribe(channel);
}
return true;
} }
return true; return false;
} }
} }

Loading…
Cancel
Save