redis-smq
Version:
A high-performance, reliable, and scalable message queue for Node.js.
20 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._checkOperationList = _checkOperationList;
const redis_smq_common_1 = require("redis-smq-common");
const index_js_1 = require("../types/index.js");
const _get_queue_state_js_1 = require("../../queue-state-manager/_/_get-queue-state.js");
const operation_registery_js_1 = require("../operation-registery.js");
function _checkOperationList(client, queueParams, operations, cb) {
(0, _get_queue_state_js_1._getQueueState)(client, queueParams, (err, queueState) => {
var _a;
if (err)
return cb(err);
if (!queueState)
return cb(new redis_smq_common_1.CallbackEmptyReplyError());
const bitmask = (_a = operation_registery_js_1.operationRegistry[queueState.to]) !== null && _a !== void 0 ? _a : 0;
const results = operations.map((op) => (bitmask & index_js_1.OperationBitmask[op]) !== 0);
cb(null, results);
});
}
//# sourceMappingURL=_check-operation-list.js.map