pub struct Driver { /* private fields */ }Expand description
The embedding thread and what it shares with the service.
Implementations§
Source§impl Driver
impl Driver
Sourcepub fn start(
storage: Arc<Mutex<Storage>>,
worker: Arc<dyn Worker>,
bounds: Bounds,
writer_wait: Duration,
) -> Result<Self, Failure>
pub fn start( storage: Arc<Mutex<Storage>>, worker: Arc<dyn Worker>, bounds: Bounds, writer_wait: Duration, ) -> Result<Self, Failure>
Start the thread over storage with worker, restarted as
Restart::default says: every field declared on every live branch
waits.
§Errors
The declared fields unread, or the thread unstarted, by name.
Sourcepub fn start_with(
storage: Arc<Mutex<Storage>>,
worker: Arc<dyn Worker>,
bounds: Bounds,
writer_wait: Duration,
restart: Restart,
) -> Result<Self, Failure>
pub fn start_with( storage: Arc<Mutex<Storage>>, worker: Arc<dyn Worker>, bounds: Bounds, writer_wait: Duration, restart: Restart, ) -> Result<Self, Failure>
As Self::start, with the worker started again as restart says.
§Errors
The declared fields unread, or the thread unstarted, by name.
Sourcepub fn start_apart(
storage: Arc<Mutex<Storage>>,
worker: Arc<dyn Worker>,
questions: Option<Arc<dyn Worker>>,
bounds: Bounds,
writer_wait: Duration,
restart: Restart,
) -> Result<Self, Failure>
pub fn start_apart( storage: Arc<Mutex<Storage>>, worker: Arc<dyn Worker>, questions: Option<Arc<dyn Worker>>, bounds: Bounds, writer_wait: Duration, restart: Restart, ) -> Result<Self, Failure>
As Self::start_with, with questions asked of questions when it
is given, never of the walk’s worker (SL1). The question worker
never commits, so it never takes the admission (JOIN1).
§Errors
The declared fields unread, or the thread unstarted, by name.
Sourcepub fn wrote(&self, branch: &str, collection: &str)
pub fn wrote(&self, branch: &str, collection: &str)
A write on branch touched collection: each field declared there
waits, once.
Sourcepub fn declared(&self, branch: &str, collection: &str, field: &str)
pub fn declared(&self, branch: &str, collection: &str, field: &str)
field of collection on branch was declared: it is known, and
its walk waits.
Sourcepub fn asker(&self) -> Result<&dyn Ask, Failure>
pub fn asker(&self) -> Result<&dyn Ask, Failure>
The worker, for a question, once it is ready: a search that finds
none ready waits for one up to embed_ready_ms, on the driver’s
signal, with no storage lock held.
§Errors
embed_worker_starting before the worker first answered;
embed_worker_restarting while one that died is started again.
Sourcepub fn field_status(
&self,
branch: &str,
collection: &str,
field: &str,
) -> &'static str
pub fn field_status( &self, branch: &str, collection: &str, field: &str, ) -> &'static str
What vectors.fields says of a field this driver serves: the
worker’s state while it is not ready, else whether its walk is open.
Sourcepub fn longer_than_model(
&self,
branch: &str,
collection: &str,
field: &str,
) -> u64
pub fn longer_than_model( &self, branch: &str, collection: &str, field: &str, ) -> u64
EMB1: the records of a field this driver has given no vector since the service started, because the model reads only part of their text.
Sourcepub fn embed_input_empty(
&self,
branch: &str,
collection: &str,
field: &str,
) -> u64
pub fn embed_input_empty( &self, branch: &str, collection: &str, field: &str, ) -> u64
EMB-E1: the records of a field this driver has passed with no vector
since the service started, because their text is empty or only
whitespace (embed_input_empty).
Sourcepub fn windows(&self, branch: &str, collection: &str, field: &str) -> (u64, u64)
pub fn windows(&self, branch: &str, collection: &str, field: &str) -> (u64, u64)
EMB-E2: the records of a field this driver has given windows, and those given none for needing more than the cap, since it started.
pub fn field_failure( &self, branch: &str, collection: &str, field: &str, ) -> Option<Value>
Source§impl Driver
impl Driver
Sourcepub fn stop(&self) -> Result<(), Failure>
pub fn stop(&self) -> Result<(), Failure>
HANG1: tell the threads to stop and wait for them on their own
signals, for at most [stop_within] in all: a page under way ends its
worker calls and its commit, and no new one starts. A thread still
running then is named and left, never waited on for ever. Each
thread is waited on once; a later call finds nothing to wait for.
§Errors
embed_thread_unended, naming each thread that did not end in time.