redis-connection-pool.js | |
Functions | |
RedisConnectionPool | A high-level redis management object. |
on | listen for redis events |
expire | Execute a redis EXPIRE command |
set | Execute a redis SET command |
get | Execute a redis GET command |
del | Execute a redis DEL command |
hset | Execute a redis HSET command |
hget | Execute a redis HGET command |
hgetall | Execute a redis HGETALL command |
rpush | Execute a redis RPUSH command |
lpush | Execute a redis LPUSH command |
blpop | Execute a redis BLPOP command |
brpop | Execute a redis BRPOP command |
clean | Clean the redis key namespace |
check | Performs a check on redis version and sets internal config based on support. |
function RedisConnectionPool( uid, cfg )
A high-level redis management object. It manages a number of connections in a pool, using them as needed and keeping all aspects of releasing active connections internal to the object, so the user does not need to worry about forgotten connections leaking memory and building up over time.
uid | (string) - Unique identifer to retreive an existing instance from elsewhere in an application. If left undefined, one will be generate automatically and avaialble via the `uid` property of the returned object. |
cfg | (object) - A series of configuration parameters to be optionally passed in and used during initialization of the object. |
cfg.host | (string) - Redis host (default: “127.0.0.1”) |
cfg.port | (number) - Redis port (default: 6379) |
cfg.max_clients | (number) - Max clients alive in the connection pool at once. (default: 30) |
cfg.perform_checks | (boolean) - Perform a series of redis checks, currently this checks to to see if blocking push/pops can be used. (default: false) |
A RedisConnectionPool object
A high-level redis management object.
function RedisConnectionPool( uid, cfg )
listen for redis events
RedisConnectionPool.prototype.on = function( type, cb )
Execute a redis EXPIRE command
RedisConnectionPool.prototype.expire = function ( key, data )
Execute a redis SET command
RedisConnectionPool.prototype.set = function ( key, data, cb )
Execute a redis GET command
RedisConnectionPool.prototype.get = function ( key, cb )
Execute a redis DEL command
RedisConnectionPool.prototype.del = function ( key )
Execute a redis HSET command
RedisConnectionPool.prototype.hset = function ( key, field, data, cb )
Execute a redis HGET command
RedisConnectionPool.prototype.hget = function ( key, field, cb )
Execute a redis HGETALL command
RedisConnectionPool.prototype.hgetall = function ( key, cb )
Execute a redis RPUSH command
RedisConnectionPool.prototype.rpush = function ( key, data, cb )
Execute a redis LPUSH command
RedisConnectionPool.prototype.lpush = function ( key, data, cb )
Execute a redis BLPOP command
RedisConnectionPool.prototype.blpop = function ( key, cb )
Execute a redis BRPOP command
RedisConnectionPool.prototype.brpop = function ( key, cb )
Clean the redis key namespace
RedisConnectionPool.prototype.clean = function ( key, cb )
Performs a check on redis version and sets internal config based on support.
RedisConnectionPool.prototype.check = function ()