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 { //...}// set up like you would `ioredis`const redis = // or setup ioredisconst redis = redisUrl redisOptionsconst redisLoader = redis logger // three commands sent to Redis together in one multiawait Promiseall redis redis redis // three commands sent separately to redisawait redisawait redisawait redis