2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-12-23 10:38:01 +00:00

Simplify PubSub code.

This commit is contained in:
Tux 2015-06-24 05:54:19 -04:00
parent 32f0dffd85
commit 2c22bc4439

View File

@ -36,6 +36,7 @@ import com.squareup.okhttp.Dispatcher;
import com.squareup.okhttp.OkHttpClient;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Plugin;
@ -496,17 +497,13 @@ public final class RedisBungee extends Plugin {
}
}
@NoArgsConstructor(access = AccessLevel.PRIVATE)
class PubSubListener implements Runnable {
private Jedis rsc;
private JedisPubSubHandler jpsh;
private PubSubListener() {
}
@Override
public void run() {
try {
rsc = pool.getResource();
try (Jedis rsc = pool.getResource()) {
jpsh = new JedisPubSubHandler();
rsc.subscribe(jpsh, "redisbungee-" + configuration.getServerId(), "redisbungee-allservers", "redisbungee-data");
} catch (JedisException | ClassCastException ignored) {
@ -537,25 +534,5 @@ public final class RedisBungee extends Plugin {
}
});
}
@Override
public void onPMessage(String s, String s2, String s3) {
}
@Override
public void onSubscribe(String s, int i) {
}
@Override
public void onUnsubscribe(String s, int i) {
}
@Override
public void onPUnsubscribe(String s, int i) {
}
@Override
public void onPSubscribe(String s, int i) {
}
}
}