@Override public void run() { boolean broken = false; try (Jedis rsc = pool.getResource()) { try { jpsh = new JedisPubSubHandler(); rsc.subscribe( jpsh, "redisbungee-" + configuration.getServerId(), "redisbungee-allservers", "redisbungee-data"); } catch (Exception e) { // FIXME: Extremely ugly hack // Attempt to unsubscribe this instance and try again. getLogger().log(Level.INFO, "PubSub error, attempting to recover.", e); jpsh.unsubscribe(); broken = true; } } if (broken) { run(); } }
public void poison() { jpsh.unsubscribe(); }
public void removeChannel(String... channel) { jpsh.unsubscribe(channel); }
public void addChannel(String... channel) { jpsh.subscribe(channel); }