nats-hemera
Advanced tools
Comparing version 5.0.5 to 5.0.6
@@ -102,2 +102,3 @@ /// <reference types="node" /> | ||
action: Function | ||
sid: number | ||
// callback | ||
@@ -104,0 +105,0 @@ use( |
@@ -27,5 +27,5 @@ 'use strict' | ||
*/ | ||
constructor(addDef, options) { | ||
constructor(addDef) { | ||
this.actMeta = addDef | ||
this.options = options | ||
this.sid = 0 | ||
this.actMeta.middleware = addDef.middleware || [] | ||
@@ -32,0 +32,0 @@ // only used for maxMessages$ flag |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -727,3 +727,2 @@ /** | ||
const pubsub = addDefinition.transport.pubsub | ||
const queueGroup = queue || `queue.${topic}` | ||
@@ -733,3 +732,3 @@ // avoid duplicate subscribers of the emit stream | ||
if (self._topics.has(topic)) { | ||
return | ||
return 0 | ||
} | ||
@@ -765,24 +764,18 @@ | ||
if (pubsub) { | ||
self._topics.set( | ||
return self._transport.subscribe( | ||
topic, | ||
self._transport.subscribe( | ||
topic, | ||
{ | ||
max: maxMessages | ||
}, | ||
handler | ||
) | ||
{ | ||
max: maxMessages | ||
}, | ||
handler | ||
) | ||
} else { | ||
// queue group names allow load balancing of services | ||
self._topics.set( | ||
return self._transport.subscribe( | ||
topic, | ||
self._transport.subscribe( | ||
topic, | ||
{ | ||
queue: queueGroup, | ||
max: maxMessages | ||
}, | ||
handler | ||
) | ||
{ | ||
queue, | ||
max: maxMessages | ||
}, | ||
handler | ||
) | ||
@@ -1031,3 +1024,3 @@ } | ||
expectedMessages: definition.expectedMessages$, | ||
queue: definition.queue$ | ||
queue: definition.queue$ || `queue.${definition.topic}` | ||
} | ||
@@ -1084,4 +1077,9 @@ } | ||
this.subscribe(addDefinition) | ||
const sid = this.subscribe(addDefinition) | ||
if (sid > 0) { | ||
addDefinition.sid = sid | ||
this._topics.set(addDefinition.pattern.topic, sid) | ||
} | ||
this._runOnAddHandler(addDefinition) | ||
@@ -1088,0 +1086,0 @@ |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -0,0 +0,0 @@ 'use strict' |
{ | ||
"name": "nats-hemera", | ||
"author": "Dustin Deus (https://github.com/StarpTech)", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://hemerajs.github.io/hemera/", |
@@ -0,0 +0,0 @@ # Hemera 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
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
76701
3066