pub struct RuntimeCloseOwner { /* private fields */ }Expand description
Own every host-supplied runtime clone and its matching registry during eviction.
The host must first stop admitting requests and wait for its active request
counter. Transfer the registry built from these runtimes and all host-held
clones. A forgotten pool/capability returns Incomplete after teardown has
committed; drop that holder and retry. Do not reopen the root until Ok.
Configuration Refused results preserve the fully usable Ready state. The bundle retains writer joins across cancelled close futures.
Dropping the bundle itself is still best effort, not successful close.
The supported scope is a single backend without embeddings, ANN, blob hydration, split events, or host background tasks. Those owners currently lack a tenant-scoped physical completion barrier and are explicitly refused. A successful return covers the owned audit tasks, SQLite pool/writer and last-store timeout sink; it is not a census of arbitrary host/provider files.
Registry packs and its audit store must belong to the supplied runtime slot. Custom packs must not hide independent file or task owners in this bundle.
Implementations§
Source§impl RuntimeCloseOwner
impl RuntimeCloseOwner
pub fn new( registry: VerbRegistry, runtimes: Vec<KhiveRuntime>, host_tasks: RuntimeCloseHostTasks, ) -> Self
pub fn phase(&self) -> RuntimeClosePhase
Sourcepub fn open_registry(&self) -> Option<&VerbRegistry>
pub fn open_registry(&self) -> Option<&VerbRegistry>
The registry remains usable after reversible refusal. It is unavailable after teardown commits, including while a close future is cancelled.
Sourcepub fn open_runtimes(&self) -> Option<&[KhiveRuntime]>
pub fn open_runtimes(&self) -> Option<&[KhiveRuntime]>
Transferred handles remain usable after reversible refusal only.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Whether close has successfully completed; errors never mark it closed.
Sourcepub fn writer_tasks_finished(&self) -> bool
pub fn writer_tasks_finished(&self) -> bool
Observe actual writer task completion without aborting or taking a join.
Sourcepub async fn close(&mut self) -> Result<(), RuntimeCloseError>
pub async fn close(&mut self) -> Result<(), RuntimeCloseError>
Stop audit admission, await physical append/reaper completion, drop all transferred roots, join the writer, then close the final store’s sink.
Cancellation only interrupts this wait. Retain this owner and call again
to resume; no accepted append or native write is aborted. A second call
after success returns Ok(()). A permanently stuck native operation can
keep close pending; a caller timeout is not evidence of settlement.
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeCloseOwner
impl !UnwindSafe for RuntimeCloseOwner
impl Freeze for RuntimeCloseOwner
impl Send for RuntimeCloseOwner
impl Sync for RuntimeCloseOwner
impl Unpin for RuntimeCloseOwner
impl UnsafeUnpin for RuntimeCloseOwner
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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