Skip to content

Commit a68f91c

Browse files
Flarnatargos
authored andcommitted
doc: add version when diagnostics_channel APIs were added
Add a yaml section to document when diagnostics_channel APIs were introduced. PR-URL: #40208 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 2fa5e50 commit a68f91c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

doc/api/diagnostics_channel.md

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

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

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

@@ -106,6 +112,12 @@ if (diagnostics_channel.hasSubscribers('my-channel')) {
106112

107113
#### `diagnostics_channel.channel(name)`
108114

115+
<!-- YAML
116+
added:
117+
- v15.1.0
118+
- v14.17.0
119+
-->
120+
109121
* `name` {string|symbol} The channel name
110122
* Returns: {Channel} The named channel object
111123

@@ -127,6 +139,12 @@ const channel = diagnostics_channel.channel('my-channel');
127139

128140
### Class: `Channel`
129141

142+
<!-- YAML
143+
added:
144+
- v15.1.0
145+
- v14.17.0
146+
-->
147+
130148
The class `Channel` represents an individual named channel within the data
131149
pipeline. It is use to track subscribers and to publish messages when there
132150
are subscribers present. It exists as a separate object to avoid channel
@@ -137,6 +155,12 @@ with `new Channel(name)` is not supported.
137155

138156
#### `channel.hasSubscribers`
139157

158+
<!-- YAML
159+
added:
160+
- v15.1.0
161+
- v14.17.0
162+
-->
163+
140164
* Returns: {boolean} If there are active subscribers
141165

142166
Check if there are active subscribers to this channel. This is helpful if
@@ -167,6 +191,12 @@ if (channel.hasSubscribers) {
167191

168192
#### `channel.publish(message)`
169193

194+
<!-- YAML
195+
added:
196+
- v15.1.0
197+
- v14.17.0
198+
-->
199+
170200
* `message` {any} The message to send to the channel subscribers
171201

172202
Publish a message to any subscribers to the channel. This will trigger
@@ -194,6 +224,12 @@ channel.publish({
194224

195225
#### `channel.subscribe(onMessage)`
196226

227+
<!-- YAML
228+
added:
229+
- v15.1.0
230+
- v14.17.0
231+
-->
232+
197233
* `onMessage` {Function} The handler to receive channel messages
198234
* `message` {any} The message data
199235
* `name` {string|symbol} The name of the channel
@@ -224,6 +260,12 @@ channel.subscribe((message, name) => {
224260

225261
#### `channel.unsubscribe(onMessage)`
226262

263+
<!-- YAML
264+
added:
265+
- v15.1.0
266+
- v14.17.0
267+
-->
268+
227269
* `onMessage` {Function} The previous subscribed handler to remove
228270

229271
Remove a message handler previously registered to this channel with

0 commit comments

Comments
 (0)