node-i3 icon indicating copy to clipboard operation
node-i3 copied to clipboard

I3IpcClient "connect" emit order is corrected.

Open ndvtr opened this issue 8 years ago • 4 comments

I3IpcClient "connect" event emit is placed after "self._stream" assign.

ndvtr avatar Apr 23 '17 12:04 ndvtr

why this was a problem? Does any code outside relies on ._stream being set?

sidorares avatar Apr 23 '17 12:04 sidorares

yes, you are right, ._stream from the outside is not very good, but I needed for example a ._stream.destroy()

ndvtr avatar Apr 23 '17 14:04 ndvtr

can you elaborate why? Maybe we need to add public api for that?

sidorares avatar Apr 23 '17 14:04 sidorares

Close/destroy socket connection after a timeout: I'm waiting a window event but not longer than 30 seconds or another logic, for example. Yes, .destroy() would be nice:

@@ -178,0 +179,5 @@ I3IpcClient.prototype.on = function(event, handler) {
+I3IpcClient.prototype.destroy = function() {
+  if (!this._stream) return;
+  this._stream.destroy();
+}

ndvtr avatar Apr 23 '17 16:04 ndvtr