Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

servicebus

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

servicebus - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

42

bus/pubsubqueue.js

@@ -12,3 +12,3 @@ var events = require('events'),

QueueRegistry.prototype.getCurrentQueues = function getCurrentQueues (callback) {
if ( ! this.queues) {
if ( ! this.queues || JSON.stringify(this.queues) === "{}") {
var self = this;

@@ -30,8 +30,18 @@ this.serializer.on('deserialized', function (queues) {

function Correlator () {
function Correlator () {
events.EventEmitter.call(this);
var self = this;
this.ready = false;
this.registry = new QueueRegistry();
this.registry.getCurrentQueues(function (err, queues) {
self.ready = true;
self.emit('ready');
});
}
util.inherits(Correlator, events.EventEmitter);
Correlator.prototype.getUniqueId = function getUniqueId (queueName, subscriptionId, callback) {
var id;
var id,
self = this;
if ( ! subscriptionId) {

@@ -41,8 +51,22 @@ id = queueName + '.' + newId();

}
if( ! this.registry.queues[subscriptionId]) {
id = queueName + '.' + newId();
this.registry.queues[subscriptionId] = id;
this.registry.setCurrentQueues(this.registry.queues, function (err) {
if (err) callback(err);
else callback(null, id);
function getIdFromQueueData () {
if( ! self.registry.queues[subscriptionId]) {
id = queueName + '.' + newId();
self.registry.queues[subscriptionId] = id;
self.registry.setCurrentQueues(self.registry.queues, function (err) {
if (err) callback(err);
else callback(null, id);
});
} else {
id = self.registry.queues[subscriptionId];
callback(null, id);
}
}
if (this.ready) {
getIdFromQueueData();
} else {
this.on('ready', function () {
getIdFromQueueData();
});

@@ -49,0 +73,0 @@ }

@@ -16,3 +16,3 @@ var events = require('events'),

var self = this;
fs.readFile(this.filename, function (err, data) {
fs.readFile(this.filename, "utf-8", function (err, data) {
if (err) {

@@ -19,0 +19,0 @@ self.emit('deserialized', {})

@@ -7,3 +7,3 @@ {

"description": "Simple service bus for sending events between processes using amqp.",
"version": "0.0.6",
"version": "0.0.7",
"homepage": "https://github.com/mateodelnorte/servicebus",

@@ -10,0 +10,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc