pub struct ReloadDispatcher<'a> { /* private fields */ }Expand description
Orchestrates per-kind reload discipline between drain and commit.
Construct with ReloadDispatcher::new, optionally populate live
resources via ReloadKindHandlers, then call Self::dispatch.
Failures abort the reload before the new plugin’s registrations
commit.
Implementations§
Source§impl<'a> ReloadDispatcher<'a>
impl<'a> ReloadDispatcher<'a>
Sourcepub fn new(
old: &'a PluginRecordSnapshot,
new_registry: &'a PluginRegistry,
) -> Self
pub fn new( old: &'a PluginRecordSnapshot, new_registry: &'a PluginRegistry, ) -> Self
Construct a dispatcher over the old plugin’s snapshot and the new plugin’s already-committed surface registry.
Sourcepub fn with_handlers(self, handlers: ReloadKindHandlers) -> Self
pub fn with_handlers(self, handlers: ReloadKindHandlers) -> Self
Attach per-kind live-resource handoffs.
Sourcepub fn check_compat(
&self,
old_providers: &OldProviders,
) -> Result<(), ReloadError>
pub fn check_compat( &self, old_providers: &OldProviders, ) -> Result<(), ReloadError>
Pre-flight check: run schema-compat checks for CRDT kinds and logical types that both old and new plugin register.
old_providers supplies the pre-swap views of the providers
the old plugin owned. The dispatcher cannot recover those from
the registry once the swap has happened, so the host snapshots
them immediately before evicting the old plugin.
§Errors
Returns ReloadError::SchemaIncompat when any pair fails its
compat check.
Sourcepub fn dispatch(self) -> Result<ReloadOutcome, ReloadError>
pub fn dispatch(self) -> Result<ReloadOutcome, ReloadError>
Drive the per-instance handoffs: persist & reopen index handles; checkpoint & restart CDC streams.
§Errors
Returns ReloadError::Persist if a handoff fails. The old
resources are dropped on failure — the host must be prepared to
surface the failure and continue serving against the new
providers’ freshly-initialized resources.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ReloadDispatcher<'a>
impl<'a> !Sync for ReloadDispatcher<'a>
impl<'a> !UnwindSafe for ReloadDispatcher<'a>
impl<'a> Freeze for ReloadDispatcher<'a>
impl<'a> Send for ReloadDispatcher<'a>
impl<'a> Unpin for ReloadDispatcher<'a>
impl<'a> UnsafeUnpin for ReloadDispatcher<'a>
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