UNPKG

redis-smq

Version:

A simple high-performance Redis message queue for Node.js.

26 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExchangeTopic = void 0; const redis_smq_common_1 = require("redis-smq-common"); const exchange_abstract_js_1 = require("../exchange-abstract.js"); const _get_topic_exchange_params_js_1 = require("./_/_get-topic-exchange-params.js"); const _get_topic_exchange_queues_js_1 = require("./_/_get-topic-exchange-queues.js"); class ExchangeTopic extends exchange_abstract_js_1.ExchangeAbstract { getQueues(exchangeParams, cb) { const topic = (0, _get_topic_exchange_params_js_1._getTopicExchangeParams)(exchangeParams); if (topic instanceof Error) cb(topic); else { this.redisClient.getSetInstance((err, client) => { if (err) cb(err); else if (!client) cb(new redis_smq_common_1.CallbackEmptyReplyError()); else (0, _get_topic_exchange_queues_js_1._getTopicExchangeQueues)(client, topic, cb); }); } } } exports.ExchangeTopic = ExchangeTopic; //# sourceMappingURL=exchange-topic.js.map