10 Commits

Author SHA1 Message Date
James Coglan ea2348682e Create CODE_OF_CONDUCT.md 2015-11-08 12:19:10 +00:00
James Coglan 684e940266 Bump Faye to 1.1.0. 2014-12-23 00:05:42 +00:00
James Coglan 5bd67aedb5 Bump faye to current master. 2014-09-07 21:54:27 +01:00
James Coglan 456b76ec71 Stop testing on Node 0.6; npm that supports the ^ operator will not run there. 2014-09-07 21:40:59 +01:00
James Coglan 04a68797f0 Upgrade Travis's copy of npm on Node 0.6 and 0.8. 2014-09-07 21:37:56 +01:00
James Coglan 49fb05e1f2 Merge pull request #15 from PeterDaveHello/patch-1
Use svg instead of png to get better image quality
2014-09-07 21:04:35 +01:00
Peter Dave Hello e76c9e736c Use svg instead of png to get better image quality 2014-08-28 20:47:09 +08:00
James Coglan 9777d1acfe Tell Travis to start Redis. 2014-06-05 21:51:58 +01:00
James Coglan 253549d2e7 Remove the trailing lines. 2014-06-05 21:43:46 +01:00
James Coglan fee61a8d65 Make the destroyClient method make all its writes in a single MULTI operation. 2014-06-05 21:42:07 +01:00
11 changed files with 32 additions and 29 deletions
+6 -2
View File
@@ -1,13 +1,17 @@
language: node_js
node_js:
- "0.6"
- "0.8"
- "0.10"
- "0.11"
services:
- redis-server
before_install:
- test $TRAVIS_NODE_VERSION = '0.8' && npm install -g npm@1.2.8000 || true
before_script:
- make
env: TRAVIS=1
-1
View File
@@ -21,4 +21,3 @@
### 0.1.0 / 2012-02-26
* Initial release: Redis backend for Faye 0.8
+4
View File
@@ -0,0 +1,4 @@
# Code of Conduct
All projects under the [Faye](https://github.com/faye) umbrella are covered by
the [Code of Conduct](https://github.com/faye/code-of-conduct).
+1 -2
View File
@@ -1,6 +1,5 @@
prepare:
git submodule update --init --recursive
cd vendor/faye && npm install
cd vendor/faye && npm install
cd vendor/faye && ./node_modules/.bin/wake
npm install
+1 -2
View File
@@ -1,4 +1,4 @@
# faye-redis [![Build Status](https://secure.travis-ci.org/faye/faye-redis-node.png)](http://travis-ci.org/faye/faye-redis-node)
# faye-redis [![Build Status](https://secure.travis-ci.org/faye/faye-redis-node.svg)](http://travis-ci.org/faye/faye-redis-node)
This plugin provides a Redis-based backend for the
[Faye](http://faye.jcoglan.com) messaging server. It allows a single Faye
@@ -63,4 +63,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18 -17
View File
@@ -81,28 +81,29 @@ Engine.prototype = {
destroyClient: function(clientId, callback, context) {
var self = this;
this._redis.zadd(this._ns + '/clients', 0, clientId, function() {
self._redis.smembers(self._ns + '/clients/' + clientId + '/channels', function(error, channels) {
var n = channels.length, i = 0;
if (i === n) return self._afterSubscriptionsRemoved(clientId, callback, context);
this._redis.smembers(this._ns + '/clients/' + clientId + '/channels', function(error, channels) {
var multi = self._redis.multi();
channels.forEach(function(channel) {
self.unsubscribe(clientId, channel, function() {
i += 1;
if (i === n) self._afterSubscriptionsRemoved(clientId, callback, context);
});
});
multi.zadd(self._ns + '/clients', 0, clientId);
channels.forEach(function(channel) {
multi.srem(self._ns + '/clients/' + clientId + '/channels', channel);
multi.srem(self._ns + '/channels' + channel, clientId);
});
});
},
multi.del(self._ns + '/clients/' + clientId + '/messages');
multi.zrem(self._ns + '/clients', clientId);
multi.publish(self._closeChannel, clientId);
multi.exec(function(error, results) {
channels.forEach(function(channel, i) {
if (results[2 * i + 1] !== 1) return;
self._server.trigger('unsubscribe', clientId, channel);
self._server.debug('Unsubscribed client ? from channel ?', clientId, channel);
});
_afterSubscriptionsRemoved: function(clientId, callback, context) {
var self = this;
this._redis.del(this._ns + '/clients/' + clientId + '/messages', function() {
self._redis.zrem(self._ns + '/clients', clientId, function() {
self._server.debug('Destroyed client ?', clientId);
self._server.trigger('disconnect', clientId);
self._redis.publish(self._closeChannel, clientId);
if (callback) callback.call(context);
});
});
-1
View File
@@ -19,4 +19,3 @@
, "url" : "git://github.com/faye/faye-redis-node.git"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ JS.Test.describe("Redis engine", function() { with(this) {
})
after(function(resume) { with(this) {
engine.disconnect()
disconnect_engine()
var redis = require('redis').createClient(6379, 'localhost', {no_ready_check: true})
redis.auth(engineOpts.password)
redis.flushall(function() {
-1
View File
@@ -39,4 +39,3 @@ list-max-ziplist-value 64
set-max-intset-entries 512
activerehashing yes
-1
View File
@@ -5,4 +5,3 @@ require('../vendor/faye/spec/javascript/engine_spec')
require('./faye_redis_spec')
JS.Test.autorun()
Vendored
+1 -1