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

Function clearImmediate

lib/timers.js:226–244  ·  view source on GitHub ↗

* Cancels an immediate. * @param {Immediate} immediate * @returns {void}

(immediate)

Source from the content-addressed store, hash-verified

224 * @returns {void}
225 */
226function clearImmediate(immediate) {
227 if (!immediate?._onImmediate || immediate._destroyed)
228 return;
229
230 immediateInfo[kCount]--;
231 immediate._destroyed = true;
232
233 if (immediate[kRefed] && --immediateInfo[kRefCount] === 0) {
234 // We need to use the binding as the receiver for fast API calls.
235 binding.toggleImmediateRef(false);
236 }
237 immediate[kRefed] = null;
238
239 emitDestroy(immediate[async_id_symbol]);
240
241 immediate._onImmediate = null;
242
243 immediateQueue.remove(immediate);
244}
245
246Immediate.prototype[SymbolDispose] = function() {
247 clearImmediate(this);

Calls 2

toggleImmediateRefMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…