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 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.