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

Method subscribe

lib/diagnostics_channel.js:130–136  ·  view source on GitHub ↗
(subscription)

Source from the content-addressed store, hash-verified

128// TODO(qard): should there be a C++ channel interface?
129class ActiveChannel {
130 subscribe(subscription) {
131 validateFunction(subscription, 'subscription');
132 this._subscribers = ArrayPrototypeSlice(this._subscribers);
133 ArrayPrototypePush(this._subscribers, subscription);
134 channels.incRef(this.name);
135 if (this._index !== undefined) subscriberCounts[this._index]++;
136 }
137
138 unsubscribe(subscription) {
139 const index = ArrayPrototypeIndexOf(this._subscribers, subscription);

Callers

nothing calls this directly

Calls 1

incRefMethod · 0.45

Tested by

no test coverage detected