/** Serializing employee nodes that must not be live at the same time. * * A node authors `mutex: ""` and then dispatches only while no other node * carrying that key is live. The lock is derived rather than stored — see * repository-mutex.ts, which reads it. Waiting is unbounded here on purpose: the * holder's own `timeoutMinutes` is what ends it, and a second clock could only * disagree with the first. */ import type { EmployeeNode } from './model.js'; import type { WorkflowMutexNodeRun } from './repository-mutex.js'; import type { WorkflowRepository } from './repository.js'; import type { WorkflowRunDetail } from './runtime.js'; /** Whoever is live on this node's key, if it is not this node itself. A `pending` * node run is another node standing off the same key rather than a holder, so two * waiters never block each other into a deadlock neither can leave. */ export declare function mutexHolder(repository: WorkflowRepository, run: WorkflowRunDetail, node: EmployeeNode): WorkflowMutexNodeRun | null; /** Write why the run is parked where the operator reads the run, not only into the * log: the key it wants and who holds it. Called once the run has nothing else it * could be doing, so it names the real reason, and only when the holder changes, so * a node standing off for an hour writes once. The record is transient by * construction: dispatching replaces `resolvedConfig` with the config it dispatched. */ export declare function recordMutexWaits(repository: WorkflowRepository, run: WorkflowRunDetail): void; /** A key lives only as long as the node run carrying it, so the moment that node goes * terminal every run standing off the key has a different answer waiting for it — and * nothing else would re-drive them: they are parked on no timer and no child, only on * this. Fired and forgotten, the way a workflow-call caller is woken. */ export declare function wakeMutexWaiters(repository: WorkflowRepository, run: WorkflowRunDetail, nodeId: string, advance: (workflowId: string, runId: string) => Promise): void; //# sourceMappingURL=node-mutex.d.ts.map