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

Function initAsyncResource

lib/internal/timers.js:164–171  ·  view source on GitHub ↗
(resource, type)

Source from the content-addressed store, hash-verified

162const knownTimersById = { __proto__: null };
163
164function initAsyncResource(resource, type) {
165 const asyncId = resource[async_id_symbol] = newAsyncId();
166 const triggerAsyncId =
167 resource[trigger_async_id_symbol] = getDefaultTriggerAsyncId();
168 resource[async_context_frame] = AsyncContextFrame.current();
169 if (initHooksExist())
170 emitInit(asyncId, type, triggerAsyncId, resource);
171}
172
173let warnedNegativeNumber = false;
174let warnedNotNumber = false;

Callers 3

constructorMethod · 0.85
insertGuardedFunction · 0.85
constructorMethod · 0.85

Calls 4

newAsyncIdFunction · 0.85
getDefaultTriggerAsyncIdFunction · 0.85
initHooksExistFunction · 0.85
currentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…