Comparing version 0.2.8 to 0.2.9
@@ -8,3 +8,3 @@ | ||
var loop = 100000; | ||
var loop = 500000; | ||
var hash = 2500; | ||
@@ -11,0 +11,0 @@ |
@@ -9,3 +9,3 @@ | ||
var loop = 50000; | ||
var loop = 500000; | ||
var hash = 1000; | ||
@@ -12,0 +12,0 @@ |
/*! | ||
* Nats | ||
* Copyright(c) 2011,2012 Derek Collison (derek.collison@gmail.com) | ||
* Copyright(c) 2011-2014 Derek Collison (derek.collison@gmail.com) | ||
* MIT Licensed | ||
@@ -20,3 +20,3 @@ */ | ||
var VERSION = '0.2.7', | ||
var VERSION = '0.2.9', | ||
@@ -276,3 +276,3 @@ DEFAULT_PORT = 4222, | ||
case AWAITING_CONTROL: | ||
if ((m = MSG.exec(client.inbound)) != null) { | ||
if ((m = MSG.exec(client.inbound)) !== null) { | ||
client.payload = { | ||
@@ -285,12 +285,12 @@ subj : m[1], | ||
client.pstate = AWAITING_MSG_PAYLOAD; | ||
} else if ((m = OK.exec(client.inbound)) != null) { | ||
} else if ((m = OK.exec(client.inbound)) !== null) { | ||
// Ignore for now.. | ||
} else if ((m = ERR.exec(client.inbound)) != null) { | ||
} else if ((m = ERR.exec(client.inbound)) !== null) { | ||
client.emit('error', m[1]); | ||
} else if ((m = PONG.exec(client.inbound)) != null) { | ||
} else if ((m = PONG.exec(client.inbound)) !== null) { | ||
var cb = client.pongs.shift(); | ||
if (cb) { cb(); } // FIXME: Should we check for exceptions? | ||
} else if ((m = PING.exec(client.inbound)) != null) { | ||
} else if ((m = PING.exec(client.inbound)) !== null) { | ||
client.sendCommand(PONG_RESPONSE); | ||
} else if ((m = INFO.exec(client.inbound)) != null) { | ||
} else if ((m = INFO.exec(client.inbound)) !== null) { | ||
// Ignore for now.. | ||
@@ -383,3 +383,3 @@ } else { | ||
Client.prototype.closeStream = function() { | ||
if (this.stream != null) { | ||
if (this.stream !== null) { | ||
this.stream.end(); | ||
@@ -405,3 +405,3 @@ this.stream.destroy(); | ||
if (this.connected === false || | ||
this.pending == null || | ||
this.pending === null || | ||
this.pending.length === 0) { return; } | ||
@@ -424,3 +424,3 @@ | ||
if (this.closed || this.pending == null) { return; } | ||
if (this.closed || this.pending === null) { return; } | ||
@@ -473,3 +473,3 @@ this.pending.push(cmd); | ||
var sub = this.subs[this.payload.sid]; | ||
if (sub != null) { | ||
if (sub !== undefined) { | ||
sub.received += 1; | ||
@@ -618,3 +618,3 @@ // Check for a timeout, and cancel if received >= expected | ||
var sub = this.subs[sid]; | ||
if (sub == null) { | ||
if (sub === undefined) { | ||
return; | ||
@@ -640,3 +640,3 @@ } | ||
var sub = this.subs[sid]; | ||
if (sub == null) { return; } | ||
if (sub === null) { return; } | ||
sub.expected = expected; | ||
@@ -643,0 +643,0 @@ sub.timeout = setTimeout(function() { callback(sid); }, timeout); |
{ | ||
"name": "nats", | ||
"description": "Node.js client for NATS, a lightweight messaging system", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"repository": { | ||
"type" : "git", | ||
"url" : "git@github.com:derekcollison/node_nats.git" | ||
"type": "git", | ||
"url": "git@github.com:derekcollison/node-nats.git" | ||
}, | ||
"homepage" : "https://github.com/derekcollison/node_nats", | ||
"homepage": "https://nats.io", | ||
"author": "Derek Collison <derek.collison@gmail.com>", | ||
"keywords": ["messaging", "pubsub", "publish", "subscribe", "queue", "distributed queueing"], | ||
"dependencies": { }, | ||
"keywords": [ | ||
"messaging", | ||
"pubsub", | ||
"publish", | ||
"subscribe", | ||
"queue", | ||
"distributed queueing" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"should": ">= 0.0.1", | ||
"mocha": "*" | ||
"coveralls": "^2.11.2", | ||
"istanbul": "^0.3.5", | ||
"jshint": "^2.5.10", | ||
"mocha": "*", | ||
"mocha-lcov-reporter": "^0.0.1", | ||
"should": ">= 3.0.0" | ||
}, | ||
"main": "index", | ||
"license" : "MIT", | ||
"scripts": { "test": "make test" }, | ||
"engines": { "node": ">= 0.4.x <= 0.10.x" } | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "make test-coveralls" | ||
}, | ||
"engines": { | ||
"node": ">= 0.8.x <= 0.10.x" | ||
} | ||
} |
@@ -1,6 +0,6 @@ | ||
# Node_Nats | ||
# NATS - Node.js Client | ||
A Node.js client for the [NATS messaging system](https://github.com/derekcollison/nats). | ||
A [Node.js](http://nodejs.org/) client for the [NATS messaging system](https://nats.io). | ||
[![Build Status](https://secure.travis-ci.org/derekcollison/node_nats.png)](http://travis-ci.org/derekcollison/node_nats) | ||
[![Build Status](https://secure.travis-ci.org/derekcollison/node-nats.png)](http://travis-ci.org/derekcollison/node-nats) [![npm version](https://badge.fury.io/js/nats.svg)](http://badge.fury.io/js/nats)[![Coverage Status](https://img.shields.io/coveralls/derekcollison/node-nats.svg)](https://coveralls.io/r/derekcollison/node-nats?branch=master) | ||
@@ -60,4 +60,5 @@ ## Installation | ||
// ">" matches any length of the tail of a subject, and can only be the last token | ||
// E.g. 'foo.>' will match 'foo.bar', 'foo.bar.baz', 'foo.foo.bar.bax.22' | ||
// ">" matches any length of the tail of a subject, and can only be | ||
// the last token E.g. 'foo.>' will match 'foo.bar', 'foo.bar.baz', | ||
// 'foo.foo.bar.bax.22' | ||
nats.subscribe('foo.>', function(msg, reply, subject) { | ||
@@ -69,8 +70,8 @@ console.log('Msg received on [' + subject + '] : ' + msg); | ||
## Queues Groups | ||
## Queue Groups | ||
```javascript | ||
// All subscriptions with the same queue name will form a queue group. | ||
// Each message will be delivered to only one subscriber per queue group, queuing semantics. | ||
// You can have as many queue groups as you wish. | ||
// Each message will be delivered to only one subscriber per queue group, | ||
// queuing semantics. You can have as many queue groups as you wish. | ||
// Normal subscribers will continue to work as expected. | ||
@@ -92,3 +93,4 @@ nats.subscribe('foo', {'queue':'job.workers'}, function() { | ||
// Flush connection to server, callback fires when all messages have been processed. | ||
// Flush connection to server, callback fires when all messages have | ||
// been processed. | ||
nats.flush(function() { | ||
@@ -128,3 +130,3 @@ console.log('All clear!'); | ||
Copyright (c) 2011-2012 Derek Collison | ||
Copyright (c) 2011-2014 Derek Collison | ||
@@ -131,0 +133,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25278
147
6