Socket
Book a DemoInstallSign in
Socket

@bustle/redis-loader

Package Overview
Dependencies
Maintainers
22
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bustle/redis-loader

An io-redis like object that batches queries with dataloader

7.0.0
latest
npmnpm
Version published
Weekly downloads
2
-87.5%
Maintainers
22
Weekly downloads
 
Created
Source

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

// 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()

Keywords

async/await

FAQs

Package last updated on 16 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.