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

Function pushAsyncContext

lib/internal/async_hooks.js:548–558  ·  view source on GitHub ↗
(asyncId, triggerAsyncId, resource)

Source from the content-addressed store, hash-verified

546
547// This is the equivalent of the native push_async_ids() call.
548function pushAsyncContext(asyncId, triggerAsyncId, resource) {
549 const offset = async_hook_fields[kStackLength];
550 execution_async_resources[offset] = resource;
551 if (offset * 2 >= async_wrap.async_ids_stack.length)
552 return pushAsyncContext_(asyncId, triggerAsyncId);
553 async_wrap.async_ids_stack[offset * 2] = async_id_fields[kExecutionAsyncId];
554 async_wrap.async_ids_stack[offset * 2 + 1] = async_id_fields[kTriggerAsyncId];
555 async_hook_fields[kStackLength]++;
556 async_id_fields[kExecutionAsyncId] = asyncId;
557 async_id_fields[kTriggerAsyncId] = triggerAsyncId;
558}
559
560
561// This is the equivalent of the native pop_async_ids() call.

Callers 3

emitBeforeScriptFunction · 0.85
processPromiseRejectionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…