Socket
Book a DemoInstallSign in
Socket

redis-subscription-pool

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-subscription-pool

Smart subscription pooling for node-redis

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

redis-subscription-pool

Smart subscription pooling for node-redis. Handles many subscriptions with one client and knows when it's save to unsubscribe.

Example

var redis = require('redis');
var Pool = require('redis-subscription-pool');

var pub = redis.createClient();
var sub = redis.createClient();
var pool = Pool(sub);

var unbind = pool.on('foo', function(msg){
  console.log('got %s', msg);
});

// ...

pub.publish('foo', 'bar');

// ...

unbind();

API

Pool(subscriber)

pool.on(channel, fn)

Subscribe fn to updates on channel. Returns an unbind function that unbinds immediately.

pool.pon(pattern, fn)

Subscribe fn to updates on pattern. Returns an unbind function that unbinds immediately.

TODO this name sucks

Installation

$ npm install redis-subscription-pool

License

MIT

FAQs

Package last updated on 14 Jan 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