Package Exports
- redis-connection-pool
- redis-connection-pool/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redis-connection-pool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
redis-connection-pool
A node.js connection pool for Redis.
https://silverbucket.github.io/redis-connection-pool
About
A high-level redis connection pooling 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.
Installation
npm install redis-connection-pool
Usage
import redisPoolFactory from 'redis-connection-pool';
const redisPool = await redisPoolFactory('myRedisPool', {
max_clients: 5, // default
redis: {
url: 'redis://localhost:6379'
}
});
await redisPool.set('test-key', 'foobar');
const foo = await redisPool.get('test-key');
// returns 'foobar'
Or you can create a pool instance directly
import RedisConnectionPool from 'redis-connection-pool';
const redisPool = new RedisConnectionPool();
await redisPool.init();
When you are done
redisPool.shutdown();
Implemented Redis methods
- blpop
- brpop
- del
- expire
- get
- hdel
- hget
- hgetall
- hset
- incr
- keys
- lpush
- rpush
- sendCommand
- set
- ttl
Additional methods
- init
- shutdown
API Documentation
For the full documentation on the RedisConnectionPool
class, see https://silverbucket.github.io/redis-connection-pool/classes/RedisConnectionPool.html