redis-smq
Version:
A simple high-performance Redis message queue for Node.js.
22 lines • 868 B
JavaScript
import { CallbackEmptyReplyError } from 'redis-smq-common';
import { ExchangeAbstract } from '../exchange-abstract.js';
import { _getTopicExchangeParams } from './_/_get-topic-exchange-params.js';
import { _getTopicExchangeQueues } from './_/_get-topic-exchange-queues.js';
export class ExchangeTopic extends ExchangeAbstract {
getQueues(exchangeParams, cb) {
const topic = _getTopicExchangeParams(exchangeParams);
if (topic instanceof Error)
cb(topic);
else {
this.redisClient.getSetInstance((err, client) => {
if (err)
cb(err);
else if (!client)
cb(new CallbackEmptyReplyError());
else
_getTopicExchangeQueues(client, topic, cb);
});
}
}
}
//# sourceMappingURL=exchange-topic.js.map