"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VPSubscriber = void 0;
const RedisSubscriber_1 = require("@golemio/core/dist/helpers/data-access/pubsub/subscribers/RedisSubscriber");
class VPSubscriber extends RedisSubscriber_1.RedisSubscriber {
    constructor(options, repository) {
        super(options);
        this.repository = repository;
    }
    async initialize() {
        await this.subscribe();
        this.logger.debug(`Redis subscriber subscribed to channel: ${this.redisChannel}`);
        this.listen((message) => {
            this.logger.debug("Redis subscriber received a message to change repository source.");
            if (message !== undefined) {
                this.repository.setCurrentSetName(message);
            }
        });
    }
}
exports.VPSubscriber = VPSubscriber;
//# sourceMappingURL=VPSubscriber.js.map