decord/source/848_getClient.js

90 lines
3.3 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 848
// Function ID: 849
// Name: getClient
// Dependencies: [825, 841, 843, 829]
// Module 848 (getClient)
2026-08-24 06:08:38 +00:00
import getGlobalSingleton from "getGlobalSingleton" /* 825 */;
import generateSpanId from "generateSpanId" /* 829 */;
import getAsyncContextStrategy from "getAsyncContextStrategy" /* 841 */;
require = arg1;
2026-07-29 08:29:29 +00:00
const dependencyMap = arg6;
Object.defineProperty(arg5, Symbol.toStringTag, { value: "Module" });
arg5.getClient = function getClient() {
2026-08-24 06:08:38 +00:00
const mainCarrier = getGlobalSingleton.getMainCarrier();
const obj = getGlobalSingleton;
const asyncContextStrategy = getAsyncContextStrategy.getAsyncContextStrategy(mainCarrier);
2026-07-29 08:29:29 +00:00
const currentScope = asyncContextStrategy.getCurrentScope();
return currentScope.getClient();
};
arg5.getCurrentScope = function getCurrentScope() {
2026-08-24 06:08:38 +00:00
const mainCarrier = getGlobalSingleton.getMainCarrier();
const obj = getGlobalSingleton;
const asyncContextStrategy = getAsyncContextStrategy.getAsyncContextStrategy(mainCarrier);
2026-07-29 08:29:29 +00:00
return asyncContextStrategy.getCurrentScope();
};
arg5.getGlobalScope = function getGlobalScope() {
2026-08-24 06:08:38 +00:00
return getGlobalSingleton.getGlobalSingleton("globalScope", () => {
2026-07-29 08:29:29 +00:00
const scope = new callback(table[2]).Scope();
return scope;
});
};
arg5.getIsolationScope = function getIsolationScope() {
2026-08-24 06:08:38 +00:00
const mainCarrier = getGlobalSingleton.getMainCarrier();
const obj = getGlobalSingleton;
const asyncContextStrategy = getAsyncContextStrategy.getAsyncContextStrategy(mainCarrier);
2026-07-29 08:29:29 +00:00
return asyncContextStrategy.getIsolationScope();
};
arg5.getTraceContextFromScope = function getTraceContextFromScope(getPropagationContext) {
const propagationContext = getPropagationContext.getPropagationContext();
const parentSpanId = propagationContext.parentSpanId;
const obj = { trace_id: propagationContext.traceId, span_id: null };
let propagationSpanId = propagationContext.propagationSpanId;
if (!propagationSpanId) {
2026-08-24 06:08:38 +00:00
propagationSpanId = generateSpanId.generateSpanId();
const obj2 = generateSpanId;
2026-07-29 08:29:29 +00:00
}
obj[1] = propagationSpanId;
if (parentSpanId) {
obj.parent_span_id = parentSpanId;
}
return obj;
};
arg5.withIsolationScope = function withIsolationScope() {
const items = [...arguments];
2026-08-24 06:08:38 +00:00
const mainCarrier = getGlobalSingleton.getMainCarrier();
const obj = getGlobalSingleton;
const asyncContextStrategy = getAsyncContextStrategy.getAsyncContextStrategy(mainCarrier);
2026-07-29 08:29:29 +00:00
if (2 === items.length) {
[tmp2, tmp3] = items;
if (tmp2) {
let result = asyncContextStrategy.withSetIsolationScope(tmp2, tmp3);
} else {
result = asyncContextStrategy.withIsolationScope(tmp3);
}
return result;
} else {
return asyncContextStrategy.withIsolationScope(items[0]);
}
2026-08-24 06:08:38 +00:00
const obj2 = getAsyncContextStrategy;
2026-07-29 08:29:29 +00:00
};
arg5.withScope = function withScope() {
const items = [...arguments];
2026-08-24 06:08:38 +00:00
const mainCarrier = getGlobalSingleton.getMainCarrier();
const obj = getGlobalSingleton;
const asyncContextStrategy = getAsyncContextStrategy.getAsyncContextStrategy(mainCarrier);
2026-07-29 08:29:29 +00:00
if (2 === items.length) {
[tmp2, tmp3] = items;
if (tmp2) {
let withSetScopeResult = asyncContextStrategy.withSetScope(tmp2, tmp3);
} else {
withSetScopeResult = asyncContextStrategy.withScope(tmp3);
}
return withSetScopeResult;
} else {
return asyncContextStrategy.withScope(items[0]);
}
2026-08-24 06:08:38 +00:00
const obj2 = getAsyncContextStrategy;
2026-07-29 08:29:29 +00:00
};