pub struct WriterSpawn {
pub handle: WriteHandle,
pub join: JoinHandle<()>,
}Expand description
What WriterActor::spawn* returns. The daemon needs the
std::thread::JoinHandle<()> so it can wait for the writer’s
shutdown() (PRAGMA wal_checkpoint(TRUNCATE), final HNSW save)
to complete after the last WriteHandle is dropped. Without this,
the OS reaps the writer thread when main returns, possibly
mid-checkpoint.
Tests that don’t care about clean shutdown timing can simply drop the JoinHandle along with the WriteHandle.
Fields§
§handle: WriteHandle§join: JoinHandle<()>Implementations§
Source§impl WriterSpawn
impl WriterSpawn
Sourcepub fn shutdown_blocking(self)
pub fn shutdown_blocking(self)
Drop the WriteHandle (closing the mpsc) and block until the writer
thread finishes its shutdown() and exits. No timeout — production
supervisors decide when to force-kill via SIGKILL.
Auto Trait Implementations§
impl Freeze for WriterSpawn
impl !RefUnwindSafe for WriterSpawn
impl Send for WriterSpawn
impl Sync for WriterSpawn
impl Unpin for WriterSpawn
impl UnsafeUnpin for WriterSpawn
impl !UnwindSafe for WriterSpawn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more