MCPcopy Index your code
hub / github.com/nodejs/node / channel

Function channel

lib/diagnostics_channel.js:262–271  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

260const channels = new WeakRefMap();
261
262function channel(name) {
263 const channel = channels.get(name);
264 if (channel) return channel;
265
266 if (typeof name !== 'string' && typeof name !== 'symbol') {
267 throw new ERR_INVALID_ARG_TYPE('channel', ['string', 'symbol'], name);
268 }
269
270 return new Channel(name);
271}
272
273function subscribe(name, subscription) {
274 return channel(name).subscribe(subscription);

Callers 11

subscribeFunction · 0.85
unsubscribeFunction · 0.85
channelFromMapFunction · 0.85
constructorMethod · 0.85
constructor.jsFile · 0.85
testFunction · 0.85
subscribeFunction · 0.85
testFunction · 0.85

Calls 1

getMethod · 0.65

Tested by 2

testFunction · 0.68
testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…