Function: emitIsolationReport()
ts
function emitIsolationReport(
hooks: IsolationObservabilityHooks | undefined,
phase: IsolationReportPhase,
base: {
serviceName?: string;
spawnCount: number;
},
extra?: Omit<
Partial<IsolationReport>,
"at" | "phase" | "serviceName" | "spawnCount"
>,
now?: () => string,
): void;Defined in: src/batteries/isolation/observability.ts:201
Build an IsolationReport (stamping at) and dispatch it to the firehose (IsolationObservabilityHooks.onIsolation) AND the per-phase-group hook for phase. A no-op when hooks is undefined or carries no relevant callbacks — callers should additionally guard expensive extra computation (e.g. approxBytes sizing) behind hasIsolationHook so it is never computed when unhooked. Each callback is invoked through safeInvoke, so a throwing consumer never disrupts the battery.
Parameters
| Parameter | Type | Description |
|---|---|---|
hooks | | IsolationObservabilityHooks | undefined | The isolation observability hooks (may be undefined). |
phase | IsolationReportPhase | The phase being reported. |
base | { serviceName?: string; spawnCount: number; } | serviceName + spawnCount, common to every report. |
base.serviceName? | string | - |
base.spawnCount? | number | - |
extra? | Omit<Partial<IsolationReport>, "at" | "phase" | "serviceName" | "spawnCount"> | Phase-specific fields (see IsolationReport). |
now? | () => string | Injectable clock for tests; defaults to new Date().toISOString(). |
Returns
void