Socket
Book a DemoInstallSign in
Socket

redis-pubsub-pair

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-pubsub-pair

Open a Redis Pub/Sub pair ensuring that Sub client is subscribed

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

redis-pubsub-pair

Build Status

Open a Redis Pub/Sub pair ensuring that Sub client is subscribed.

Usage

var redis = require('redis');
var createPubSubPair = require('redis-pubsub-pair');

var pair = createPubSubPair(redis.createClient, {
  redis: {
    host: 'localhost',
    port: 6379
  },
  channel: 'pubsub'
}, function (err) {
  var sub = pair.sub;
  var pub = pair.pub;

  if (err) {
    throw err;
  }

  sub.on('message', function (channel, data) {
    console.log('message:', channel, data.toString('utf8'));
  });

  pub.publish('pubsub', 'hello world');
});

FAQs

Package last updated on 11 Nov 2013

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