MCPcopy Create free account
hub / github.com/nodejs/undici / getCurrentTransaction

Function getCurrentTransaction

test/node-test/async_hooks.js:14–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const transactions = new Map()
13
14function getCurrentTransaction () {
15 const asyncId = executionAsyncId()
16 return transactions.has(asyncId) ? transactions.get(asyncId) : null
17}
18
19function setCurrentTransaction (trans) {
20 const asyncId = executionAsyncId()

Callers 2

initFunction · 0.85
async_hooks.jsFile · 0.85

Calls 2

hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected