Skip to content

Commit 07bbb07

Browse files
simon-idnodejs-github-bot
authored andcommittedOct 19, 2021
lib: add unsubscribe method to non-active DC channels
PR-URL: nodejs#40433 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Zijian Liu <[email protected]>
1 parent d0670e7 commit 07bbb07

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎doc/api/diagnostics_channel.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ added:
267267
changes:
268268
- version: REPLACEME
269269
pr-url: https://github.com/nodejs/node/pull/40433
270-
description: Added return value.
270+
description: Added return value. Added to channels without subscribers.
271271
-->
272272

273273
* `onMessage` {Function} The previous subscribed handler to remove

‎lib/diagnostics_channel.js

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class Channel {
8181
this.subscribe(subscription);
8282
}
8383

84+
unsubscribe() {
85+
return false;
86+
}
87+
8488
get hasSubscribers() {
8589
return false;
8690
}

0 commit comments

Comments
 (0)
Please sign in to comment.