redis-smq
Version:
A high-performance, reliable, and scalable message queue for Node.js.
16 lines • 759 B
JavaScript
import { CallbackEmptyReplyError, } from 'redis-smq-common';
import { OperationBitmask } from '../types/index.js';
import { _getQueueState } from '../../queue-state-manager/_/_get-queue-state.js';
import { operationRegistry } from '../operation-registery.js';
export function _checkOperationList(client, queueParams, operations, cb) {
_getQueueState(client, queueParams, (err, queueState) => {
if (err)
return cb(err);
if (!queueState)
return cb(new CallbackEmptyReplyError());
const bitmask = operationRegistry[queueState.to] ?? 0;
const results = operations.map((op) => (bitmask & OperationBitmask[op]) !== 0);
cb(null, results);
});
}
//# sourceMappingURL=_check-operation-list.js.map