@elastic.io/amqp-rpc
Advanced tools
Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "@elastic.io/amqp-rpc", | ||
"description": "RPC over RabbitMQ for Node.js", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"homepage": "http://elastic.io", | ||
@@ -6,0 +6,0 @@ "author": "elastic.io GmbH <info@elastic.io>", |
@@ -152,2 +152,3 @@ const Command = require('./Command'); | ||
clearTimeout(timer); | ||
this._requests.delete(correlationId); | ||
reject(new Error(`sendCommand canceled due to ${reason}, command:${command}, correlationId:${correlationId}`)); | ||
@@ -154,0 +155,0 @@ } |
@@ -39,3 +39,3 @@ 'use strict'; | ||
await server.start(); | ||
client = new AMQPRPCClient(connection, {requestsQueue: server.requestsQueue}); | ||
client = new AMQPRPCClient(connection, {requestsQueue: server.requestsQueue, timeout: 200 }); | ||
await client.start(); | ||
@@ -60,2 +60,7 @@ }); | ||
}); | ||
it('should delete timedout requests from map', async () => { | ||
server.addCommand('command', () => new Promise(sinon.stub())); | ||
await expect(client.sendCommand('command')).to.be.rejectedWith(Error); | ||
expect(client._requests.size).to.equal(0); | ||
}); | ||
it('should pass arguments from client call to server', async () => { | ||
@@ -62,0 +67,0 @@ const commandStub = sinon.stub(); |
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
85202
2093