How to use the async-hook-jl._state function in async-hook-jl

To help you get started, we’ve selected a few async-hook-jl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instana / nodejs-sensor / packages / core / src / tracing / clsHooked / context-legacy.js View on Github external
process.namespaces[name] = null;
}

function reset() {
  // must unregister async listeners
  if (process.namespaces) {
    Object.keys(process.namespaces).forEach(function(name) {
      destroyNamespace(name);
    });
  }
  process.namespaces = Object.create(null);
}

process.namespaces = {};

if (asyncHook._state && !asyncHook._state.enabled) {
  asyncHook.enable();
}

async-hook-jl

Inspect the life of handle objects in node

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis