Skip to main content

Module mutation_queue

Module mutation_queue 

Source
Expand description

Per-realpath serialization for file mutations (edit / write).

Ports .references/pi/packages/coding-agent/src/core/tools/file-mutation-queue.ts. Operations targeting the same canonical path run FIFO; operations on distinct paths run concurrently. The queue key is realpath(resolve(path)), falling back to the lexically resolved path when the target does not yet exist (ENOENT / ENOTDIR). Map entries are cleaned up when the last waiter for a key finishes, including on cancellation via a drop guard.

Enums§

MutationQueueError
Errors produced while registering a path into the mutation queue.

Functions§

with_file_mutation_queue
Serialize f against every other mutation targeting the same realpath. Distinct keys run in parallel. TypeScript withFileMutationQueue.