Skip to content

Class: StepContinuationQueue ​

Defined in: runtime/locks/step-continuation-queue.ts:10

Per-stepExecId asynchronous FIFO serialization queue for ContinuationFrame[] mutations (SPEC.md §3.7.2).

Coordinates all concurrent updates to a step's continuation call stack via a per-step PQueue (concurrency: 1) so sibling downward forks and speculative branches never overwrite each other in LedgerStore.updateContinuationStack.

Constructors ​

Constructor ​

ts
new StepContinuationQueue(): StepContinuationQueue;

Returns ​

StepContinuationQueue

Methods ​

clearStep() ​

ts
clearStep(stepExecId): void;

Defined in: runtime/locks/step-continuation-queue.ts:82

Clears and removes any PQueue entry tracked for stepExecId.

Invoked when a step execution reaches a terminal state and no further stack mutations can occur.

Parameters ​

ParameterTypeDescription
stepExecIdstringStep execution identifier to clear.

Returns ​

void


enqueueUpdate() ​

ts
enqueueUpdate<TResult>(
   stepExecId, 
   task, 
   signal?
): Promise<TResult>;

Defined in: runtime/locks/step-continuation-queue.ts:28

Enqueues task behind all prior updates for stepExecId and returns its completion promise.

Continues draining subsequent queued tasks for stepExecId even if an earlier task rejects or is cancelled via signal, and evicts the step's PQueue instance once idle.

Type Parameters ​

Type ParameterDescription
TResultReturn type of the queued update callback.

Parameters ​

ParameterTypeDescription
stepExecIdstringUnique step execution identifier to serialize on.
task() => Promise<TResult>Asynchronous continuation update callback.
signal?AbortSignalOptional cancellation signal for queued updates.

Returns ​

Promise<TResult>

Promise resolving or rejecting with the outcome of task.


hasStepQueue() ​

ts
hasStepQueue(stepExecId): boolean;

Defined in: runtime/locks/step-continuation-queue.ts:71

Checks whether stepExecId currently holds an active or queued PQueue instance.

Returns false once all pending and queued continuation updates for stepExecId have drained.

Parameters ​

ParameterTypeDescription
stepExecIdstringStep execution identifier to inspect.

Returns ​

boolean

True when a non-evicted queue entry exists for stepExecId.

Released under the MIT License.