com.jetdrone.vertx.mods.redis.RedisSubscriptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mod-redis-io Show documentation
Show all versions of mod-redis-io Show documentation
Asynchronous REDIS bus module for Vert.x
The newest version!
package com.jetdrone.vertx.mods.redis;
import com.jetdrone.vertx.mods.redis.util.MessageHandler;
import java.util.HashMap;
import java.util.Map;
public class RedisSubscriptions {
private final Map subscribers = new HashMap();
public void registerSubscribeHandler(String channelOrPattern, MessageHandler messageHandler) {
subscribers.put(channelOrPattern, messageHandler);
}
public void unregisterSubscribeHandler(String channelOrPattern) {
if (channelOrPattern == null) {
subscribers.clear();
} else {
subscribers.remove(channelOrPattern);
}
}
public MessageHandler getHandler(String channelOrPattern) {
return subscribers.get(channelOrPattern);
}
public int size() {
return subscribers.size();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy