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 richardlau committed Jan 25, 2022
1 parent 625be75 commit 004eafb
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 @@ -162,7 +162,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 004eafb

Please sign in to comment.