Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d1e4736

Browse files
committedSep 24, 2021
doc: add version when diagnostics_channel APIs were added
Add a yaml section to document when diagnostics_channel APIs were introduced.
1 parent 8006586 commit d1e4736

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
 

‎doc/api/diagnostics_channel.md

+35
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ if (channel.hasSubscribers) {
7979

8080
#### `diagnostics_channel.hasSubscribers(name)`
8181

82+
<!-- YAML
83+
added: v15.1.0
84+
added: v14.17.0
85+
-->
86+
8287
* `name` {string|symbol} The channel name
8388
* Returns: {boolean} If there are active subscribers
8489

@@ -106,6 +111,11 @@ if (diagnostics_channel.hasSubscribers('my-channel')) {
106111

107112
#### `diagnostics_channel.channel(name)`
108113

114+
<!-- YAML
115+
added: v15.1.0
116+
added: v14.17.0
117+
-->
118+
109119
* `name` {string|symbol} The channel name
110120
* Returns: {Channel} The named channel object
111121

@@ -127,6 +137,11 @@ const channel = diagnostics_channel.channel('my-channel');
127137

128138
### Class: `Channel`
129139

140+
<!-- YAML
141+
added: v15.1.0
142+
added: v14.17.0
143+
-->
144+
130145
The class `Channel` represents an individual named channel within the data
131146
pipeline. It is use to track subscribers and to publish messages when there
132147
are subscribers present. It exists as a separate object to avoid channel
@@ -137,6 +152,11 @@ with `new Channel(name)` is not supported.
137152

138153
#### `channel.hasSubscribers`
139154

155+
<!-- YAML
156+
added: v15.1.0
157+
added: v14.17.0
158+
-->
159+
140160
* Returns: {boolean} If there are active subscribers
141161

142162
Check if there are active subscribers to this channel. This is helpful if
@@ -167,6 +187,11 @@ if (channel.hasSubscribers) {
167187

168188
#### `channel.publish(message)`
169189

190+
<!-- YAML
191+
added: v15.1.0
192+
added: v14.17.0
193+
-->
194+
170195
* `message` {any} The message to send to the channel subscribers
171196

172197
Publish a message to any subscribers to the channel. This will trigger
@@ -194,6 +219,11 @@ channel.publish({
194219

195220
#### `channel.subscribe(onMessage)`
196221

222+
<!-- YAML
223+
added: v15.1.0
224+
added: v14.17.0
225+
-->
226+
197227
* `onMessage` {Function} The handler to receive channel messages
198228
* `message` {any} The message data
199229
* `name` {string|symbol} The name of the channel
@@ -224,6 +254,11 @@ channel.subscribe((message, name) => {
224254

225255
#### `channel.unsubscribe(onMessage)`
226256

257+
<!-- YAML
258+
added: v15.1.0
259+
added: v14.17.0
260+
-->
261+
227262
* `onMessage` {Function} The previous subscribed handler to remove
228263

229264
Remove a message handler previously registered to this channel with

0 commit comments

Comments
 (0)
Please sign in to comment.