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
public boolean onStatus(PubSubType type, String channel) {
if (type == PubSubType.PSUBSCRIBE) {
listener.onPSubscribe(channel);
} else if (type == PubSubType.PUNSUBSCRIBE) {
listener.onPUnsubscribe(channel);
if (channel.equals(name)) {
if (type == PubSubType.PSUBSCRIBE) {
listener.onPSubscribe(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
public boolean onStatus(PubSubType type, String channel) {
if (type == PubSubType.SUBSCRIBE) {
listener.onSubscribe(channel);
} else if (type == PubSubType.UNSUBSCRIBE) {
listener.onUnsubscribe(channel);
if (channel.equals(name)) {
if (type == PubSubType.SUBSCRIBE) {
listener.onSubscribe(channel);
} else if (type == PubSubType.UNSUBSCRIBE) {
listener.onUnsubscribe(channel);
}
return true;
}
return true;
return false;
}
}

Loading…
Cancel
Save