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

@twilson63/palmetto-rmq

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilson63/palmetto-rmq - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

.npmignore

39

index.js

@@ -12,19 +12,42 @@ var servicebus = require('servicebus')

establishConnection(config, ee);
return ee
}
function establishConnection(config, ee) {
var bus = servicebus.bus({
url: config.endpoint,
vhost: config.vhost || null
});
bus.on('error', (err) => {
ee.emit('error', err);
});
// If this is a reconnection, the old listener is being replaced
ee.removeAllListeners(['send']);
ee.on('send', function (event) {
config.roundRobin ? bus.send(config.app, event) : bus.publish(config.app, event);
})
if (!config.publishOnly) {
config.roundRobin ? bus.listen(config.app, notify) : bus.subscribe(config.app, notify);
function notify (event) {
if (event.to) ee.emit(event.to, event)
}
if (config.roundRobin) {
bus.listen(config.app, notify);
} else {
bus.subscribe(config.app, notify);
}
}
function notify (event) {
if (event.to) ee.emit(event.to, event)
// Automatically reconnect on closed connections (true by default)
if (config.reconnect !== false) {
bus.on('connection_close', () => {
bus = establishConnection(config, ee);
});
}
return bus;
}
ee.on('send', function (event) {
config.roundRobin ? bus.send(config.app, event) : bus.publish(config.app, event);
})
return ee
}
{
"name": "@twilson63/palmetto-rmq",
"version": "1.1.0",
"version": "1.2.0",
"description": "",

@@ -17,4 +17,4 @@ "main": "index.js",

"dependencies": {
"servicebus": "^1.0.15"
"servicebus": "https://github.com/ryanvm/servicebus.git#feature/expose-addtional-channel-conn-events"
}
}

@@ -14,3 +14,4 @@ var test = require('tap').test

},
send: function () {}
send: function () {},
on: function() {}
}

@@ -17,0 +18,0 @@ }

@@ -14,3 +14,4 @@ var test = require('tap').test

}
},
on: function() {}
}

@@ -26,2 +27,2 @@ }

t.end()
})
})

@@ -13,3 +13,4 @@ var test = require('tap').test

t.deepEquals(e, { to: 'widget.request.create', name: 'foobar'}, 'should equal object')
}
},
on: function() {}
}

@@ -27,2 +28,2 @@ }

t.end()
})
})

@@ -14,3 +14,4 @@ var test = require('tap').test

},
publish: function () {}
publish: function () {},
on: function() {}
}

@@ -17,0 +18,0 @@ }

Sorry, the diff of this file is not supported yet

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