Skip to content

Commit

Permalink
lib: add unsubscribe method to non-active DC channels
Browse files Browse the repository at this point in the history
PR-URL: #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]>
  • Loading branch information
simon-id authored and targos committed Oct 23, 2021
1 parent aa61551 commit 1ddbae2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/diagnostics_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ added:
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/40433
description: Added return value.
description: Added return value. Added to channels without subscribers.
-->

* `onMessage` {Function} The previous subscribed handler to remove
Expand Down
4 changes: 4 additions & 0 deletions lib/diagnostics_channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ class Channel {
this.subscribe(subscription);
}

unsubscribe() {
return false;
}

get hasSubscribers() {
return false;
}
Expand Down

0 comments on commit 1ddbae2

Please sign in to comment.