Skip to main content

WriterActor

Struct WriterActor 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for WriterActor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for WriterActor

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V