UNPKG

redis-smq

Version:

A high-performance, reliable, and scalable message queue for Node.js.

18 lines 851 B
import { redisKeys } from '../../common/redis/redis-keys/redis-keys.js'; import { ExchangeNotFoundError } from '../../errors/index.js'; import { EExchangeProperty } from '../types/index.js'; export function _getExchangeProperties(client, exchange, cb) { const { keyExchange } = redisKeys.getExchangeKeys(exchange.ns, exchange.name); client.hgetall(keyExchange, (err, rawProperties) => { if (err) return cb(err); if (!rawProperties || !Object.keys(rawProperties).length) return cb(new ExchangeNotFoundError()); const exchangeProperties = { type: Number(rawProperties[EExchangeProperty.TYPE]), queuePolicy: Number(rawProperties[EExchangeProperty.QUEUE_POLICY]), }; cb(null, exchangeProperties); }); } //# sourceMappingURL=_get-exchange-properties.js.map