pub struct WriterActor { /* private fields */ }Expand description
Single-threaded writer that serializes all mutations through one SQLite connection.
On drop, the channel is closed and the writer thread is joined, ensuring all
in-flight writes complete and the SQLite connection closes cleanly.
Implementations§
Source§impl WriterActor
impl WriterActor
Sourcepub fn start(
path: impl AsRef<Path>,
schema_manager: Arc<SchemaManager>,
provenance_mode: ProvenanceMode,
telemetry: Arc<TelemetryCounters>,
) -> Result<Self, EngineError>
pub fn start( path: impl AsRef<Path>, schema_manager: Arc<SchemaManager>, provenance_mode: ProvenanceMode, telemetry: Arc<TelemetryCounters>, ) -> Result<Self, EngineError>
§Errors
Returns EngineError if the writer thread cannot be spawned.
Sourcepub fn submit(&self, request: WriteRequest) -> Result<WriteReceipt, EngineError>
pub fn submit(&self, request: WriteRequest) -> Result<WriteReceipt, EngineError>
§Errors
Returns EngineError if the write request validation fails, the writer actor has shut
down, or the underlying SQLite transaction fails.
Sourcepub fn touch_last_accessed(
&self,
request: LastAccessTouchRequest,
) -> Result<LastAccessTouchReport, EngineError>
pub fn touch_last_accessed( &self, request: LastAccessTouchRequest, ) -> Result<LastAccessTouchReport, EngineError>
§Errors
Returns EngineError if validation fails, the writer actor has shut down,
or the underlying SQLite transaction fails.
Sourcepub fn claim_vector_projection(
&self,
request: VectorProjectionClaimRequest,
) -> Result<Vec<VectorWorkClaim>, EngineError>
pub fn claim_vector_projection( &self, request: VectorProjectionClaimRequest, ) -> Result<Vec<VectorWorkClaim>, EngineError>
Claim up to request.limit pending vector_projection_work rows with
priority >= request.min_priority, transitioning them to
state = 'inflight' inside a single writer transaction. Returns the
claimed rows with their current chunk text.
§Errors
Returns EngineError if the writer actor has shut down or the
underlying SQL fails.
Sourcepub fn apply_vector_projection(
&self,
request: VectorProjectionApplyRequest,
) -> Result<(), EngineError>
pub fn apply_vector_projection( &self, request: VectorProjectionApplyRequest, ) -> Result<(), EngineError>
Apply the result of an embed call: insert successful embeddings into
per-kind vec tables and delete the work rows; mark others discarded;
revert others to pending with an incremented attempt_count.
§Errors
Returns EngineError if the writer actor has shut down or the
underlying SQL fails.