Socket
Socket
Sign inDemoInstall

redis-connection-pool

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-connection-pool - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

doc/search/FunctionsI.html

56

doc/javascript/searchdata.js
var indexSectionsWithContent = {
"Files": {
"Functions": {
"Symbols": false,
"Numbers": false,
"A": false,
"B": false,
"C": false,
"D": false,
"E": false,
"B": true,
"C": true,
"D": true,
"E": true,
"F": false,
"G": false,
"H": false,
"I": false,
"G": true,
"H": true,
"I": true,
"J": false,
"K": false,
"L": false,
"L": true,
"M": false,
"N": false,
"O": false,
"O": true,
"P": false,
"Q": false,
"R": true,
"S": false,
"S": true,
"T": false,

@@ -32,3 +32,3 @@ "U": false,

},
"General": {
"Files": {
"Symbols": false,

@@ -38,19 +38,19 @@ "Numbers": false,

"B": false,
"C": true,
"D": true,
"E": true,
"F": true,
"C": false,
"D": false,
"E": false,
"F": false,
"G": false,
"H": false,
"I": false,
"J": true,
"J": false,
"K": false,
"L": false,
"M": true,
"M": false,
"N": false,
"O": true,
"O": false,
"P": false,
"Q": false,
"R": true,
"S": true,
"S": false,
"T": false,

@@ -64,18 +64,18 @@ "U": false,

},
"Functions": {
"General": {
"Symbols": false,
"Numbers": false,
"A": false,
"B": true,
"B": false,
"C": true,
"D": true,
"E": true,
"F": false,
"G": true,
"H": true,
"F": true,
"G": false,
"H": false,
"I": false,
"J": false,
"J": true,
"K": false,
"L": true,
"M": false,
"L": false,
"M": true,
"N": false,

@@ -82,0 +82,0 @@ "O": true,

{
"name": "redis-connection-pool",
"version": "1.3.0",
"version": "1.4.0",
"description": "a redis client connection pool",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -77,3 +77,3 @@ /**

var i = 0;
this.pool = Pool({
this.pool = new Pool({
name: self.uid,

@@ -95,3 +95,3 @@ create: function (callback) {

debug('2. selected database: ' + client.selected_db);
callback(null, client);
callback(err, client);
});

@@ -134,3 +134,3 @@ });

RedisConnectionPool.prototype.on = function(type, cb) {
client = redis.createClient();
var client = redis.createClient();
client.on(type, cb);

@@ -174,2 +174,17 @@ };

/**
* Function: ttl
*
* Execute a redis TTL command
*
* Parameters:
*
* key - (string) - A key whose TTL(time-to-expire) has to be returned
*
*/
RedisConnectionPool.prototype.ttl = function (key, cb) {
_getFuncs.apply(this, ['ttl', key, cb]);
};
/**
* Function: set

@@ -348,3 +363,3 @@ *

if ((keys) && (keys.forEach)) {
keys.forEach(function (name, pos) {
keys.forEach(function (name) {
debug('deleting name ' + name);

@@ -378,2 +393,16 @@ self.del(name);

/**
* Function: incr
*
* Execute a redis INCR command
*
* Parameters:
*
* key - (string) - A key whose value you wish to increment
* cb - (function) - Callback to be executed on completion
*
*/
RedisConnectionPool.prototype.incr = function (key, cb) {
_getFuncs.apply(this, ['incr', key, cb]);
};

@@ -461,3 +490,3 @@

pool.acquire(function (err, client) {
if ((funcName === 'get') || (funcName === 'hgetall')) {
if ((funcName === 'get') || (funcName === 'hgetall') || (funcName === 'ttl') || (funcName === 'incr')) {
redisGet.apply(self, [funcName, client, key, cb]);

@@ -573,6 +602,6 @@ } else if (funcName === 'blpop') {

var RedisConnectionPoolWrapper;
var redisConnectionPoolWrapper;
(function () {
var redisConnectionPools = {};
RedisConnectionPoolWrapper = function (uid, cfg) {
redisConnectionPoolWrapper = function (uid, cfg) {
if (typeof redisConnectionPools[uid] === 'object') {

@@ -596,4 +625,4 @@ return redisConnectionPools[uid];

return RedisConnectionPoolWrapper(uid, cfg);
return redisConnectionPoolWrapper(uid, cfg);
};

@@ -257,2 +257,42 @@ if (typeof define !== 'function') {

{
desc: "#expire",
timeout: 2000,
run: function (env, test) {
env.redisPool.expire(env.channel + 'test', 100, function (err) {
test.assert(err, null);
});
}
},
{
desc: "#ttl",
timeout: 2000,
run: function (env, test) {
env.redisPool.ttl(env.channel + 'test', function (err, reply) {
test.assertAnd(err, null);
test.assert(reply > 0, true);
});
}
},
{
desc: "#set",
timeout: 2000,
run: function (env, test) {
env.redisPool.set(env.channel + 'test', 1, function (err) {
test.assert(err, null);
});
}
},
{
desc: "#incr",
timeout: 2000,
run: function (env, test) {
env.redisPool.incr(env.channel + 'test', function (err) {
test.assert(err, null);
});
}
}
]

@@ -259,0 +299,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc