@Override
        public void run() {
            boolean first = true;
            while (!this.messenger.closing && !Thread.interrupted() && this.isRedisAlive()) {
                try {
                    if (first) {
                        first = false;
                    } else {
                        this.messenger.plugin.getLogger().info("Redis pubsub connection re-established");
                    }

                    this.messenger.jedis.subscribe(this, CHANNEL); // blocking call
                } catch (Exception e) {
                    if (this.messenger.closing) {
                        return;
                    }

                    this.messenger.plugin.getLogger().warn("Redis pubsub connection dropped, trying to re-open the connection", e);
                    try {
                        unsubscribe();
                    } catch (Exception ignored) {

                    }

                    // Sleep for 5 seconds to prevent massive spam in console
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException ie) {
                        Thread.currentThread().interrupt();
                    }
                }
            }
        }
An implementation of {@link Messenger} using Redis.
common/src/main/java/me/lucko/luckperms/common/messaging/redis/RedisMessenger.java