Skip to content

Commit

Permalink
doc: deprecate diagnostics_channel object subscribe method
Browse files Browse the repository at this point in the history
  • Loading branch information
Qard committed Jun 1, 2022
1 parent 9afcd29 commit 0fcf021
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions doc/api/diagnostics_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ added:
* `name` {string|symbol} The channel name
* Returns: {Channel} The named channel object

This is the primary entry-point for anyone wanting to interact with a named
This is the primary entry-point for anyone wanting to publish to a named
channel. It produces a channel object which is optimized to reduce overhead at
publish time as much as possible.

Expand Down Expand Up @@ -308,8 +308,11 @@ channel.publish({
added:
- v15.1.0
- v14.17.0
deprecated: REPLACEME
-->

> Stability: 0 - Deprecated: Use [`diagnostics_channel.subscribe(name, onMessage)`][]
* `onMessage` {Function} The handler to receive channel messages
* `message` {any} The message data
* `name` {string|symbol} The name of the channel
Expand Down Expand Up @@ -344,6 +347,7 @@ channel.subscribe((message, name) => {
added:
- v15.1.0
- v14.17.0
deprecated: REPLACEME
changes:
- version:
- v17.1.0
Expand All @@ -353,6 +357,8 @@ changes:
description: Added return value. Added to channels without subscribers.
-->

> Stability: 0 - Deprecated: Use [`diagnostics_channel.unsubscribe(name, onMessage)`][]
* `onMessage` {Function} The previous subscribed handler to remove
* Returns: {boolean} `true` if the handler was found, `false` otherwise.

Expand Down Expand Up @@ -389,5 +395,6 @@ channel.unsubscribe(onMessage);

[`'uncaughtException'`]: process.md#event-uncaughtexception
[`channel.subscribe(onMessage)`]: #channelsubscribeonmessage
[`diagnostics_channel.subscribe(name, onMessage)`]: #diagnostics_channelunsubscribename_onmessage
[`diagnostics_channel.channel(name)`]: #diagnostics_channelchannelname
[`diagnostics_channel.subscribe(name, onMessage)`]: #diagnostics_channelsubscribename-onmessage
[`diagnostics_channel.unsubscribe(name, onMessage)`]: #diagnostics_channelunsubscribename-onmessage

0 comments on commit 0fcf021

Please sign in to comment.