Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/silverbucket/redis-connection-pool
A node.js connection manager for Redis
https://github.com/silverbucket/redis-connection-pool
generic-pool pool redis redis-client
Last synced: 2 months ago
JSON representation
A node.js connection manager for Redis
- Host: GitHub
- URL: https://github.com/silverbucket/redis-connection-pool
- Owner: silverbucket
- Created: 2013-12-18T14:29:52.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-13T01:35:02.000Z (about 1 year ago)
- Last Synced: 2024-10-12T17:30:03.366Z (3 months ago)
- Topics: generic-pool, pool, redis, redis-client
- Language: TypeScript
- Homepage: https://silverbucket.github.io/redis-connection-pool
- Size: 980 KB
- Stars: 60
- Watchers: 7
- Forks: 30
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
redis-connection-pool
=====================A node.js connection pool for Redis.
https://silverbucket.github.io/redis-connection-pool
[![Build Status](http://img.shields.io/travis/silverbucket/node-redis-connection-pool.svg?style=flat)](http://travis-ci.org/silverbucket/node-redis-connection-pool)
[![license](https://img.shields.io/npm/l/redis-connection-pool.svg?style=flat)](https://npmjs.org/package/redis-connection-pool)
[![downloads](http://img.shields.io/npm/dm/redis-connection-pool.svg?style=flat)](https://npmjs.org/package/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
```javascript
npm install redis-connection-pool
```## Usage
```javascript
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
```javascript
import RedisConnectionPool from 'redis-connection-pool';
const redisPool = new RedisConnectionPool();
await redisPool.init();
```When you are done
```javascript
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## License
[MIT](https://github.com/silverbucket/node-redis-connection-pool/blob/master/LICENSE)