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.
Installation
npm i --save @bustle/redis-loader
or
yarn add @bustle/redis-loader
Examples
function logger (stats) {
}
const redis = redisLoader('redis://localhost:6379/1', { keyPrefix: 'foo', logger })
const redis = new Redis(redisUrl, redisOptions)
const redisLoader = new RedisLoader({ redis, logger })
await Promise.all([
redis.ping(),
redis.dbsize(),
redis.time()
])
await redis.ping()
await redis.dbsize()
await redis.time()