From 9e4e3c69c530e28b2c0fa2edd3da419712af7fd3 Mon Sep 17 00:00:00 2001 From: Cris Mihalache Date: Mon, 3 Feb 2020 14:33:16 +0700 Subject: [PATCH] (feature) add reconnect() method to ws2 manager --- CHANGELOG | 3 +++ lib/ws2_manager.js | 7 +++++++ package.json | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index cdbc1519..7007c76d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +4.0.2 +- WS2Manager: add reconnect method + 4.0.1 - WSv2: fix fte and ftu event routing diff --git a/lib/ws2_manager.js b/lib/ws2_manager.js index eec2b8af..9e7c0b81 100644 --- a/lib/ws2_manager.js +++ b/lib/ws2_manager.js @@ -41,6 +41,13 @@ class WS2Manager extends EventEmitter { } } + /** + * Reconnects all open sockets + */ + reconnect () { + this._sockets.forEach(socket => socket.ws.reconnect()) + } + /** * Closes all open sockets */ diff --git a/package.json b/package.json index a75c31fc..e15dbb97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitfinex-api-node", - "version": "4.0.1", + "version": "4.0.2", "description": "Node reference library for Bitfinex API", "engines": { "node": ">=7"