@sera4/essentia 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
- package/package.tar.gz +0 -0
- package/queue/index.js +17 -1
package/index.js
CHANGED
package/package.json
CHANGED
package/package.tar.gz
CHANGED
|
Binary file
|
package/queue/index.js
CHANGED
|
@@ -171,6 +171,22 @@ class S4Queue {
|
|
|
171
171
|
this.pubs[name] = p;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Registers a new fanout publisher on the given exchange.
|
|
176
|
+
* If exchange doesn't exist, one will be created.
|
|
177
|
+
* @param {String} exchange the name of the exchange on AMQP service.
|
|
178
|
+
*/
|
|
179
|
+
async registerFanoutPublisher(exchange) {
|
|
180
|
+
const name = exchange;
|
|
181
|
+
if (Object.keys(this.pubs).includes(name)) {
|
|
182
|
+
throw new Error(`Publisher ${name} already registered`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const p = new Publisher(exchange, 'fanout', true, name);
|
|
186
|
+
await p.init(this.connection);
|
|
187
|
+
this.pubs[name] = p;
|
|
188
|
+
}
|
|
189
|
+
|
|
174
190
|
/**
|
|
175
191
|
* Registers a new direct subscriber on a given exchange and queue.
|
|
176
192
|
* If exchange and queue don't exists, they'll be created
|
|
@@ -291,4 +307,4 @@ class S4Queue {
|
|
|
291
307
|
}
|
|
292
308
|
}
|
|
293
309
|
|
|
294
|
-
module.exports = new S4Queue();
|
|
310
|
+
module.exports = new S4Queue();
|