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 <vlad2t@hotmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
  • Loading branch information
simon-id authored and danielleadams committed Jan 29, 2022
1 parent 594fe55 commit 5e606b5
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 5e606b5

Please sign in to comment.