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

limitd-client

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limitd-client - npm Package Compare versions

Comparing version 2.10.3 to 2.11.0

test/disconnect.tests.js

20

client.js

@@ -174,14 +174,15 @@ const url = require('url');

this.once('connect', done);
const self = this;
this.socket = reconnect({
initialDelay: 5,
maxDelay: 50
initialDelay: 200,
maxDelay: 1000
}, stream => {
this._onNewStream(stream);
}).once('connect', (connection) => {
connection.setKeepAlive(true, 50);
connection.setNoDelay();
setImmediate(() => {
this.emit('connect');
done();
this.socket.once('disconnect', (err) => {
this.emit('disconnect', err);
});
self.emit('connect');
}).on('close', (has_error) => {

@@ -218,2 +219,5 @@ this.emit('close', has_error);

LimitdClient.prototype._onNewStream = function (stream) {
stream.setKeepAlive(true, 50);
stream.setNoDelay();
stream

@@ -220,0 +224,0 @@ .pipe(lps.decode())

2

package.json
{
"name": "limitd-client",
"version": "2.10.3",
"version": "2.11.0",
"description": "limitd client for node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -84,2 +84,14 @@ [![Build Status](https://travis-ci.org/limitd/node-client.svg)](https://travis-ci.org/limitd/node-client)

## Events
- `connect`: emitted when the client connects to the server.
- `disconnect([err])`: emitted when the client disconnects from the server.
- `error`: emitted in case of errors
- `reconnect(n, delay)`: emitted when attempting to restablish the connection. See [reconnect-core](https://www.npmjs.com/package/reconnect-core).
- `trip(err, failures, cooldown)`: emitted when the circuit-breaker mechanism trips.
- `ready`: emitted when the client is ready to send requests.
- `response`: emitted when the client receives a response. Useful for metrics and debug.
Note: Events on the shard client have the same signature but the last parameter is the instance of the client.
## Sharding

@@ -86,0 +98,0 @@

@@ -58,3 +58,4 @@ const LimitdClient = require('./client');

.on('connect', () => this.emit('connect', client))
.on('reconnect', () => this.emit('reconnect', client))
.on('disconnect', (err) => this.emit('disconnect', err, client))
.on('reconnect', (n, delay) => this.emit('reconnect', n, delay, client))
.on('close', () => this.emit('close', client))

@@ -61,0 +62,0 @@ .on('ready', () => this.emit('ready', client))

@@ -61,3 +61,3 @@ const net = require('net');

this._server.port = listener.address().port;
done();
if (done) { done(); }
});

@@ -64,0 +64,0 @@ };

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