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

@pager/jackrabbit

Package Overview
Dependencies
Maintainers
15
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pager/jackrabbit - npm Package Compare versions

Comparing version 4.5.3 to 4.6.0

51

lib/exchange.js

@@ -31,2 +31,6 @@ var amqp = require('amqplib/callback_api');

var DEFAULT_RPC_CLIENT_OPTIONS = {
timeout: 3000
};
module.exports = exchange;

@@ -57,3 +61,5 @@

connect: connect,
publish: publish
publish: publish,
rpcClient: rpcClient,
rpcServer: rpcServer
});

@@ -63,2 +69,42 @@

function rpcClient (key, msg, options, replyTo) {
if(!key) {
throw new Error('missing rpc method');
}
if(!replyTo && typeof options === 'function') {
replyTo = options;
}
if (!options || typeof options !== 'object') {
options = DEFAULT_RPC_CLIENT_OPTIONS;
}
var timeout = setTimeout(() => {
replyTo(new Error('Timeout'));
}, options.timeout || DEFAULT_RPC_CLIENT_OPTIONS.timeout);
function onReply (reply) {
clearTimeout(timeout);
replyTo(reply);
}
function onNotFound (notFound) {
clearTimeout(timeout);
replyTo(new Error('Not Found'));
}
publish(msg, {
key: key,
mandatory: true,
reply: onReply,
notFound: onNotFound
});
}
function rpcServer (key, handler) {
var rpcQueue = createQueue({ key: key, name: key, prefetch: 1, durable: false, autoDelete: true });
rpcQueue.consume(handler);
}
function connect(con) {

@@ -131,2 +177,5 @@ connection = con;

}
if (opts.mandatory && opts.notFound) {
channel.on('return', opts.notFound);
}
var drained = channel.publish(emitter.name, opts.key, new Buffer(msg), opts);

@@ -133,0 +182,0 @@ if (drained) onDrain();

2

package.json
{
"name": "@pager/jackrabbit",
"version": "4.5.3",
"version": "4.6.0",
"description": "Easy RabbitMQ for node",

@@ -5,0 +5,0 @@ "keywords": [

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