Socket
Socket
Sign inDemoInstall

primus-cluster

Package Overview
Dependencies
31
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

14

lib/adapter.js

@@ -52,3 +52,4 @@ /**

/**
* Get rooms socket is subscribed to.
* Get the list of rooms joined by the socket or the list
* of all active rooms.
*

@@ -62,3 +63,12 @@ * @param {String} id Socket id

cb = cb || noop;
this.client.smembers(socketKey.format(id), cb);
if (id) return this.client.smembers(socketKey.format(id), cb);
this.client.keys('room:*', function (err, rooms) {
if (err) return cb(err);
cb(undefined, rooms.map(function (room) {
return room.slice(5);
}));
});
};

@@ -65,0 +75,0 @@

5

lib/primus-cluster.js

@@ -51,3 +51,6 @@ /**

PrimusCluster.prototype.initializeClients = function initializeClients(options) {
options = options || {};
options = _.defaults(options || {}, {
host: '127.0.0.1',
port: 6379
});

@@ -54,0 +57,0 @@ this.clients = {};

{
"name": "primus-cluster",
"version": "1.0.1",
"version": "1.0.2",
"description": "Scale Primus across multiple servers.",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -73,2 +73,10 @@ var redis = require('redis');

});
it('should return all rooms when the `id` argument is falsy', function (done) {
adapter.get(null, function (err, rooms) {
if (err) return done(err);
expect(rooms).to.have.members(['my:room:name', 'my:second:room:name']);
done();
});
});
});

@@ -75,0 +83,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc