@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
25 lines (24 loc) • 774 B
JavaScript
import { getMainCarrier, getSentryCarrier } from "../carrier.js";
import { getStackAsyncContextStrategy } from "./stackStrategy.js";
// src/asyncContext/index.ts
/**
* @private Private API with no semver guarantees!
*
* Sets the global async context strategy
*/
function setAsyncContextStrategy(strategy) {
const registry = getMainCarrier();
const sentry = getSentryCarrier(registry);
sentry.acs = strategy;
}
/**
* Get the current async context strategy.
* If none has been setup, the default will be used.
*/
function getAsyncContextStrategy(carrier) {
const sentry = getSentryCarrier(carrier);
if (sentry.acs) return sentry.acs;
return getStackAsyncContextStrategy();
}
export { getAsyncContextStrategy, setAsyncContextStrategy };
//# sourceMappingURL=index.js.map