Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 004eafb

Browse filesBrowse files
simon-idrichardlau
authored andcommitted
lib: add unsubscribe method to non-active DC channels
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>
1 parent 625be75 commit 004eafb
Copy full SHA for 004eafb

File tree

Expand file treeCollapse file tree

2 files changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/diagnostics_channel.md‎

Copy file name to clipboardExpand all lines: doc/api/diagnostics_channel.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ added:
162162
changes:
163163
- version: REPLACEME
164164
pr-url: https://github.com/nodejs/node/pull/40433
165-
description: Added return value.
165+
description: Added return value. Added to channels without subscribers.
166166
-->
167167

168168
* `onMessage` {Function} The previous subscribed handler to remove
Collapse file

‎lib/diagnostics_channel.js‎

Copy file name to clipboardExpand all lines: lib/diagnostics_channel.js
+4Lines changed: 4 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.