Huge News!Announcing our $40M Series B led by Abstract Ventures.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

A redis client that callback immediately when no connection is present.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

redis-quick-callback

NPM

An enhancement to 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.

Usage

Create a new client using the same API as mranney/node-redis

var redis = require('redis-quick-callback');
var client = redis.createClient();
client.on('ready', function () {
  // when no connection exists, err is returned immediately, the "set" is queued
  client.set('key', 'value', function (err) {
    console.log(err); // Err: No connection to server
  });

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

});

Build and Test

The code can be built using gulp as follows

$ gulp 

Tests require redis to be running at localhost:6379

Run tests using

$ npm test

Keywords

FAQs

Package last updated on 26 Sep 2014

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

  • 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