Skip to Content

Jobs and broadcasts

InMemoryJobRegistry

Minimal demo registry:

MethodBehavior
createJob()Allocates jobId, stores queued, emits JobProgressWireEvent.
setRunning(jobId, percent?)Marks running, optional percent.
complete(jobId, result?)Marks done at 100%.
fail(jobId, detail?)Marks failed with optional detail.
get(jobId)Read current row.

Session store

FunctionDescription
sessionCreate(sessionKey?)Creates UUID session row.
sessionStep(sessionId, step, payload)Merges payload into session data.
resetSessionStore()Clears all sessions (tests).

Inspector broadcasts (selected exports)

ExportWhen emitted
broadcastGeneric envelope for custom tooling.
broadcastJobProgressCalled by InMemoryJobRegistry.
broadcastReturnResolvedSuccessful Return path.
broadcastErrorThrownThrow or unexpected errors.
broadcastApiResponseApiReturn on HTTP handlers.
setBroadcastSink / clearBroadcastSinkRedirect inspector traffic to a custom consumer.
runWithInspectorBroadcastTargetRun a block with a specific socket/correlation target.
readInspectorSocketIdFromHeadersParse x-socket-id from header maps.

Prefer transports (startInspectorWebSocket, attachCatRPC) for normal QA wiring — use sinks only for tests or side channels.

See also