Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A connection proxy of Redis for SUBSCRIBE
CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src
test
README.md
package.json

README.md

This is a proxy of Redis for SUBSCRIBE.

In typical situation of using Pub/Sub of Redis, you want to subscribe many channels on a single process.

But that makes you to create many clients resulting EMFILE error.

This module proxies many SUBSCRIBE clients to a single Redis connection.

usage

    var proxy = require("redis-sub-proxy"),
        connection, sub1, sub2;

    connection = proxy.createConnection(6379, 'localhost'); // extention of redis.RedisClient

    sub1 = connection.createClient();
    sub1.subscribe('chat:room1')
    sub1.on("message", function(ch, msg){ console.log("sub1: ", ch, msg) })

    sub2 = connection.createClient();
    sub2.subscribe('chat:room2')
    sub2.on("message", function(ch, msg){ console.log("sub2: ", ch, msg) })
Something went wrong with that request. Please try again.