You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make a pull request, to expose the _isDisconnecting flag in client.js. This will allow the application to determine if node-rdkafka is in the middle of disconnecting, when calling disconnect() in an async fashion.
Please see below for the simple patch, as I am not sure I have the permissions to push my branch. Please advise next steps.
From 1f5b1b93fe3a664a558450bf1e8601a257f054fb Mon Sep 17 00:00:00 2001
From: Keith Chew <keith.chew@propellerhead.co.nz>
Date: Thu, 21 Nov 2019 20:23:54 +1300
Subject: [PATCH] expose isDisconnecting flag
---
lib/client.js | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/client.js b/lib/client.js
index 96d1be7..92fd2fb 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -83,6 +83,7 @@ function Client(globalConf, SubClientType, topicConf) {
this.metrics = {};
this._isConnected = false;
+ this._isDisconnecting = false;
this.errorCounter = 0;
/**
@@ -254,6 +255,15 @@ Client.prototype.isConnected = function() {
return !!(this._isConnected && this._client);
};
+/**
+ * Whether or not we are disconnecting from Kafka.
+ *
+ * @return {boolean} - Whether we are disconnecting.
+ */
+Client.prototype.isDisconnecting = function() {
+ return !!(this._isDisconnecting && this._client);
+ };
+
/**
* Get the last error emitted if it exists.
*
--
2.18.0.windows.1
The text was updated successfully, but these errors were encountered:
Hi
I would like to make a pull request, to expose the _isDisconnecting flag in client.js. This will allow the application to determine if node-rdkafka is in the middle of disconnecting, when calling disconnect() in an async fashion.
Please see below for the simple patch, as I am not sure I have the permissions to push my branch. Please advise next steps.
The text was updated successfully, but these errors were encountered: