pub struct EngineRuntime { /* private fields */ }Expand description
Core engine runtime.
§Drop order invariant
Fields are ordered so that coordinator (reader connections) drops before
writer (writer thread + connection). This ensures the writer’s
sqlite3_close() is the last connection to the database, which triggers
SQLite’s automatic passive WAL checkpoint and WAL/shm file cleanup.
_vector_actor drops after writer and before _rebuild so the vector
projection thread stops submitting writer messages before the writer
channel closes (actually the writer drops first because we hold the
writer in an Arc shared with the admin service, and the Arc survives
through admin; effectively the admin handle drops before the vector
actor’s join).
_rebuild drops before _lock so the rebuild thread’s connection closes
before the exclusive file lock is released.
_lock drops last so the exclusive file lock is released only after all
connections are closed. Do not reorder these fields.
telemetry holds shared counters and has no drop-order concern (atomics).
Implementations§
Source§impl EngineRuntime
impl EngineRuntime
Sourcepub fn open(
path: impl AsRef<Path>,
provenance_mode: ProvenanceMode,
vector_dimension: Option<usize>,
read_pool_size: usize,
telemetry_level: TelemetryLevel,
query_embedder: Option<Arc<dyn QueryEmbedder>>,
) -> Result<Self, EngineError>
pub fn open( path: impl AsRef<Path>, provenance_mode: ProvenanceMode, vector_dimension: Option<usize>, read_pool_size: usize, telemetry_level: TelemetryLevel, query_embedder: Option<Arc<dyn QueryEmbedder>>, ) -> Result<Self, EngineError>
§Errors
Returns EngineError if the database connection cannot be opened, schema bootstrap fails,
or the writer actor cannot be started.
pub fn coordinator(&self) -> &ExecutionCoordinator
pub fn writer(&self) -> &WriterActor
Sourcepub fn writer_arc(&self) -> Arc<WriterActor>
pub fn writer_arc(&self) -> Arc<WriterActor>
Cloneable shared handle to the writer actor.
pub fn admin(&self) -> &AdminHandle
Sourcepub fn telemetry(&self) -> &Arc<TelemetryCounters>
pub fn telemetry(&self) -> &Arc<TelemetryCounters>
Shared telemetry counters for incrementing from the public API layer.
Sourcepub fn telemetry_snapshot(&self) -> TelemetrySnapshot
pub fn telemetry_snapshot(&self) -> TelemetrySnapshot
Read all telemetry counters and aggregate SQLite cache status across
the reader pool.