lib: add unsubscribe method to non-active DC channels

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
simon-id 2021-10-19 12:01:41 +02:00 committed by Node.js GitHub Bot
parent d0670e7559
commit 07bbb07119
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -81,6 +81,10 @@ class Channel {
this.subscribe(subscription);
}
unsubscribe() {
return false;
}
get hasSubscribers() {
return false;
}