From e9c3c38a537f9d57ef9a73a6652f6ce3a33168ee Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 12 May 2021 19:46:55 +0200 Subject: [PATCH] Add SlaveConnection.id Add .id property to access the id of the slave this SlaveConnection is for. --- packages/master/src/SlaveConnection.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/master/src/SlaveConnection.js b/packages/master/src/SlaveConnection.js index c2487efe..9bbdfd4e 100644 --- a/packages/master/src/SlaveConnection.js +++ b/packages/master/src/SlaveConnection.js @@ -41,6 +41,15 @@ class SlaveConnection extends BaseConnection { } } + /** + * ID of the slave this connection is connected to + * + * @returns {number} slave ID. + */ + get id() { + return this._id; + } + async instanceStatusChangedEventHandler(message, event) { let instance = this._master.instances.get(message.data.instance_id);