New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redis-quick-callback

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-quick-callback - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "redis-quick-callback",
"version": "0.0.1",
"version": "0.0.2",
"description": "A redis client that callback immediately when no connection is present.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

redis-quick-callback
====================
[![NPM](https://nodei.co/npm/redis-quick-callback.png)](https://nodei.co/npm/redis-quick-callback/)
An enhancement to [mranney/node-redis](https://github.com/mranney/node_redis) that calls back immediately when no connection is present. When a connection is lost, `node-redis` client takes anywhere between 200ms to 2500ms to callback. One way around this to turn off `enable_offline_queue` and loose the awesome offline queuing functionality. This client calls back immediately and executes the command asynchronously.

@@ -13,3 +15,3 @@

client.on('ready', function () {
// when no connection exists
// when no connection exists, err is returned immediately, the "set" is queued
client.set('key', 'value', function (err) {

@@ -19,3 +21,3 @@ console.log(err); // Err: No connection to server

// redis connection is back
// when redis connection is back, the queued "set" is executed and the value is available
client.get('key', function (err, data) {

@@ -41,2 +43,2 @@ console.log(data); // 'value'

$ npm test
```
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc