6.3.2 • Published 5 years ago
redis-loader v6.3.2
RedisLoader
An ioredis
-like object that batches commands via dataloader
. Under the hood we have dataloader
utilize redis's multi
transactions and pipelining to group commands called. We also support batching in streams, using bluestream
to make sure promises/async functions play nice in them.
Installation
npm i --save redis-loader
or
yarn add redis-loader
Examples
// RedisLoader supports an optional logger function with stats on each batch of commands
function logger (stats) {
//...
}
// set up like you would `ioredis`
const redis = redisLoader('redis://localhost:6379/1', { keyPrefix: 'foo', logger })
// or setup ioredis
const redis = new Redis(redisUrl, redisOptions)
const redisLoader = new RedisLoader({ redis, logger })
// three commands sent to Redis together in one multi
await Promise.all([
redis.ping(),
redis.dbsize(),
redis.time()
])
// three commands sent separately to redis
await redis.ping()
await redis.dbsize()
await redis.time()
6.3.2
5 years ago
6.3.1
5 years ago
6.3.0
5 years ago
6.2.0
5 years ago
6.1.1
5 years ago
6.1.0
5 years ago
6.0.0
5 years ago
5.0.1
5 years ago
5.0.0
5 years ago
4.1.0
6 years ago
4.0.0
6 years ago
3.0.0
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.2.1
6 years ago
1.1.1
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.0.1
6 years ago