ioredis-conn-pool
Note: A redis pool client
Table of contents
Installation
npm install --save ioredis-conn-pool # or cnpm install --save ioredis-conn-pool
Usage
'use strict'; const RedisPool = ; const pool = redis: port: 6379 // Redis port host: '127.0.0.1' // Redis host password: 'auth' pool: min: 2 max: 10 ; { let client; try // get a connection for redis client = await pool; // save something to redis client; // get something from redis const result = await client; console; // delete something from redis client; console; catch e // caught an error console; finally // finally release redis client to pool if client await pool; console; // close connection with redis process;} ;