UNPKG

redis-smq

Version:

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

19 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRedisForQueueOperation = getRedisForQueueOperation; const with_shared_pool_connection_js_1 = require("../redis/redis-connection-pool/with-shared-pool-connection.js"); const _validate_operation_js_1 = require("../../queue-operation-validator/_/_validate-operation.js"); const _parse_queue_params_js_1 = require("../../queue-manager/_/_parse-queue-params.js"); function getRedisForQueueOperation(queue, operation, queueOperationFn, callback) { (0, with_shared_pool_connection_js_1.withSharedPoolConnection)((client, cb) => { const queueParams = (0, _parse_queue_params_js_1._parseQueueParams)(queue); if (queueParams instanceof Error) return cb(queueParams); (0, _validate_operation_js_1._validateOperation)(client, queueParams, operation, (err) => { if (err) return cb(err); queueOperationFn(client, cb); }); }, callback); } //# sourceMappingURL=get-redis-for-queue-operation.js.map