redis-connection-pool
A node.js connection pool for Redis.
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,
redis: {
url: 'redis://localhost:6379'
}
});
await redisPool.set('test-key', 'foobar');
const foo = await redisPool.get('test-key');
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
- del
- blpop
- brpop
- brpoplpush
- expire
- get
- hget
- hgetall
- hset
- hdel
- incr
- lpush
- rpush
- set
- sendCommand
- ttl
Additional methods
API Documentation
For the full documentation on the RedisConnectionPool
class, see API.md.
License
MIT