node-nats-streaming
Advanced tools
@@ -1,1 +0,1 @@ | ||
{"processes":{"6607987c-8871-4139-8d59-43b77de7593a":{"parent":null,"children":[]}},"files":{"/Users/synadia/Dropbox/code/src/github.com/nats-io/stan.js/lib/stan.js":["6607987c-8871-4139-8d59-43b77de7593a"]},"externalIds":{}} | ||
{"processes":{"624a7578-2d86-4e20-96fd-c36c300401d3":{"parent":null,"children":[]}},"files":{"/Users/synadia/Dropbox/code/src/github.com/nats-io/stan.js/lib/stan.js":["624a7578-2d86-4e20-96fd-c36c300401d3"]},"externalIds":{}} |
@@ -682,3 +682,18 @@ /* | ||
this.subMap[retVal.inbox] = retVal | ||
retVal.inboxSub = this.nc.subscribe(retVal.inbox, this.processMsg()) | ||
retVal.inboxSub = this.nc.subscribe(retVal.inbox, (rawMsg, reply, subject) => { | ||
const sub = this.subMap[subject] | ||
if (!sub || !sub.ackInbox || !this.nc || sub.isClosed()) { | ||
return | ||
} | ||
try { | ||
// noinspection JSUnresolvedVariable | ||
const m = proto.pb.MsgProto.deserializeBinary(Buffer.from(rawMsg, 'binary')) | ||
const msg = new Message(this, m, sub) | ||
sub.emit('message', msg) | ||
msg.maybeAutoAck() | ||
} catch (error) { | ||
sub.emit('error', error) | ||
} | ||
}) | ||
const sr = new proto.pb.SubscriptionRequest() | ||
@@ -875,26 +890,2 @@ sr.setClientId(this.clientID) | ||
/** | ||
* Internal function to process in-bound messages. | ||
* @return {Function} | ||
* @private | ||
*/ | ||
Stan.prototype.processMsg = function () { | ||
// curry | ||
return (rawMsg, reply, subject) => { | ||
const sub = this.subMap[subject] | ||
try { | ||
// noinspection JSUnresolvedVariable | ||
const m = proto.pb.MsgProto.deserializeBinary(Buffer.from(rawMsg, 'binary')) | ||
if (sub === undefined || !this.nc) { | ||
return | ||
} | ||
const msg = new Message(this, m, sub) | ||
sub.emit('message', msg) | ||
msg.maybeAutoAck() | ||
} catch (error) { | ||
sub.emit('error', error) | ||
} | ||
} | ||
} | ||
/** | ||
* Represents a message received from the streaming server. | ||
@@ -901,0 +892,0 @@ * @param stanClient |
@@ -5,5 +5,5 @@ # Maintainers | ||
### Core-maintainers | ||
### Maintainers | ||
- Alberto Ricart <alberto@nats.io> [@aricart](https://github.com/aricart) | ||
- Derek Collison <derek@nats.io> [@derekcollison](https://github.com/derekcollison) | ||
- Ivan Kozlovic <ivan@nats.io> [@kozlovic](https://github.com/kozlovic) | ||
- Ivan Kozlovic <ivan@nats.io> [@kozlovic](https://github.com/kozlovic) |
{ | ||
"name": "node-nats-streaming", | ||
"version": "0.3.3-0", | ||
"version": "0.3.3-1", | ||
"description": "Node.js client for NATS Streaming, a lightweight, high-performance cloud native messaging system", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
256666
-0.01%4367
-0.21%