xcraft-core-busclient 5.0.3 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +14 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -448,16 +448,24 @@ class BusClient extends EventEmitter {
|
|
|
448
448
|
stop(callback) {
|
|
449
449
|
xLog.verb(`Stopping for ${this._orcName || 'greathall'}...`);
|
|
450
450
|
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
451
|
+
const isConnected = this._connected;
|
|
452
|
+
|
|
453
|
+
if (isConnected) {
|
|
454
|
+
const unsubscribe = this._subscribeClose((err) => {
|
|
455
|
+
unsubscribe();
|
|
456
|
+
if (callback) {
|
|
457
|
+
callback(err);
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
457
461
|
|
|
458
462
|
this._connected = false;
|
|
459
463
|
this._subSocket.stop();
|
|
460
464
|
this._pushSocket.stop();
|
|
465
|
+
|
|
466
|
+
if (!isConnected && callback) {
|
|
467
|
+
callback();
|
|
468
|
+
}
|
|
461
469
|
}
|
|
462
470
|
|
|
463
471
|
/**
|