Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/co-redis/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
/**
* Module dependencies.
*/
var promisify = require('es6-promisify');
var EventEmitter = require('events').EventEmitter;
/**
* List of API functions that do not take a callback as an argument
* since they are not redis commands.
*
* @constant
* @type {Array}
*/
var API_FUNCTIONS = ['end', 'unref'];
/**
* Wrap `client`.
*
* @param {Redis} client
* @return {Object}
*/
module.exports = function (client) {
var wrap = {};
wrap.multi = function (cmds) {
var multi = client.multi(cmds);
multi.exec = promisify(multi.exec, multi);
return multi;
};
wrap.batch = function (cmds) {
var batch = client.batch(cmds);
batch.exec = promisify(batch.exec, batch);
return batch;
};
wrap.pipeline = function(){
var pipeline = client.pipeline();
pipeline.exec = promisify(pipeline.exec, pipeline);
return pipeline;
};
Object.keys(client).forEach(function (key) {
wrap[key] = client[key];
});
Object.keys(EventEmitter.prototype).forEach(function (key) {
if (typeof client[key] != 'function') return;
wrap[key] = client[key].bind(client);
});
Object.defineProperty(wrap, 'connected', {
get: function () { return client.connected }
});
Object.defineProperty(wrap, 'retry_delay', {
get: function () { return client.retry_delay }
});
Object.defineProperty(wrap, 'retry_backoff', {
get: function () { return client.retry_backoff }
});
var nowrap = {
'multi': true,
'batch': true,
'pipeline': true
};
Object.keys(Object.getPrototypeOf(client)).forEach(function (key) {
var protoFunction = client[key].bind(client);
var isCommand = API_FUNCTIONS.indexOf(key) === -1;
if (nowrap[key]) return;
if (isCommand) {
protoFunction = promisify(protoFunction, client);
}
wrap[key] = protoFunction;
});
return wrap;
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0286 ]-- |