@@ -150,7 +150,7 @@ pipeline. It is use to track subscribers and to publish messages when there
150
150
are subscribers present. It exists as a separate object to avoid channel
151
151
lookups at publish time, enabling very fast publish speeds and allowing
152
152
for heavy use while incurring very minimal cost. Channels are created with
153
- [ ` diagnostics_channel.channel(name) ` ] [ ] , constructing a channel directly
153
+ \ [` diagnostics_channel.channel(name) ` ] \ [] , constructing a channel directly
154
154
with ` new Channel(name) ` is not supported.
155
155
156
156
#### ` channel.hasSubscribers `
@@ -236,7 +236,8 @@ added:
236
236
237
237
Register a message handler to subscribe to this channel. This message handler
238
238
will be run synchronously whenever a message is published to the channel. Any
239
- errors thrown in the message handler will trigger an [ ` 'uncaughtException' ` ] [ ] .
239
+ errors thrown in the message handler will trigger an
240
+ \[ ` 'uncaughtException' ` ] \[ ] .
240
241
241
242
``` mjs
242
243
import diagnostics_channel from ' node:diagnostics_channel' ;
@@ -277,7 +278,7 @@ changes:
277
278
* Returns: {boolean} ` true ` if the handler was found, ` false ` otherwise.
278
279
279
280
Remove a message handler previously registered to this channel with
280
- [ ` channel.subscribe(onMessage) ` ] [ ] .
281
+ \ [` channel.subscribe(onMessage) ` ] \ [] .
281
282
282
283
``` mjs
283
284
import diagnostics_channel from ' node:diagnostics_channel' ;
@@ -307,6 +308,33 @@ channel.subscribe(onMessage);
307
308
channel .unsubscribe (onMessage);
308
309
```
309
310
310
- [ `'uncaughtException'` ] : process.md#event-uncaughtexception
311
- [ `channel.subscribe(onMessage)` ] : #channelsubscribeonmessage
312
- [ `diagnostics_channel.channel(name)` ] : #diagnostics_channelchannelname
311
+ ### Built-in Channels
312
+
313
+ #### HTTP
314
+
315
+ ` http.client.request.start ` : Emited with arguments ` request ` when client
316
+ starts a request.
317
+
318
+ * ` request ` {http.ClientRequest}
319
+
320
+ ` http.client.response.finish ` : Emited with arguments ` request ` , ` response `
321
+ when client receives a response.
322
+
323
+ * ` request ` {http.ClientRequest}
324
+ * ` response ` {http.IncomingMessage}
325
+
326
+ ` http.server.request.start ` : Emited with arguments ` request ` , ` response ` ,
327
+ ` socket ` , ` server ` when server receives a request.
328
+
329
+ * ` request ` {http.IncomingMessage}
330
+ * ` response ` {http.ServerResponse}
331
+ * ` socket ` {net.Socket}
332
+ * ` server ` {http.Server}
333
+
334
+ ` http.server.response.finish ` : Emited with arguments ` request ` , ` response ` ,
335
+ ` socket ` , ` server ` when server sends a response.
336
+
337
+ * ` request ` {http.IncomingMessage}
338
+ * ` response ` {http.ServerResponse}
339
+ * ` socket ` {net.Socket}
340
+ * ` server ` {http.Server}
0 commit comments