class

Kamil::Persistence::WritePipeline

Inherits Reference < Object

[FUNC-003] [TECH-003] Single-Writer FIFO Write Pipeline Serialized single-writer pipeline managing atomic disk persistence, decoupled parsing, and SQLite WAL index transactions.

Consumes write operations sequentially through a dedicated background worker fiber, ensuring crash-resilient disk writes, zero database lock contention (SQLITE_BUSY), and anti-echo sentinel integration.

Constructors

new(store : IndexStore, sentinel : AntiEchoSentinel, root_path : Path | String, queue_capacity : Int32 = 100)

Initializes the write pipeline with store, sentinel, root directory path, and queue capacity.

Source

Instance methods

close

Closes the write pipeline queue channel.

Source
dispatch(operation : WriteOperation) : WriteResult

Dispatches a write operation to the serialized queue and synchronously awaits the result.

Source
ingest_batch(content_dir : Path | String = @root_path) : Int32

Performs a high-throughput startup batch scan, directly indexing documents into the store bypassing channel queue overhead.

Source
queue
Source
root_path
Source
sentinel
Source
start_worker(store : IndexStore = @store, sentinel : AntiEchoSentinel = @sentinel, root_path : Path | String = @root_path) : Nil

Spawns or updates the background worker fiber "kamil-write-worker". Idempotent: ensures only one worker fiber processes the queue.

Source
store
Source