pub struct HotConfigActivator<C> { /* private fields */ }Expand description
A config-pointer-swap Activator: the hot-reload analog of the stager’s
symlink or image swap.
It resolves a ReleaseId to a staged config value and swaps the live
HotConfig to it, so driving a Stager with this activator makes
stage_and_apply verify, apply, health-check, and roll back a config
reload with no changes to the stager itself. The previous bundle’s value
stays registered, so an auto-rollback (a flip back to the previous release)
is a pointer swap, never a re-download.
Clone to hold a staging handle alongside the copy the stager owns: both clones share the same live handle and the same registry.
Implementations§
Source§impl<C> HotConfigActivator<C>
impl<C> HotConfigActivator<C>
Sourcepub fn new(live: HotConfig<C>, initial: ReleaseId) -> Self
pub fn new(live: HotConfig<C>, initial: ReleaseId) -> Self
Build an activator over live, registering its current value under
initial so a rollback to the starting release resolves.
initial is the ReleaseId the Stager is constructed with as its
live version; registering the current value under it makes the first
auto-rollback a pointer swap back to the value that is live right now.
Trait Implementations§
Source§impl<C> Activator for HotConfigActivator<C>
impl<C> Activator for HotConfigActivator<C>
Auto Trait Implementations§
impl<C> Freeze for HotConfigActivator<C>
impl<C> RefUnwindSafe for HotConfigActivator<C>where
C: RefUnwindSafe,
impl<C> Send for HotConfigActivator<C>
impl<C> Sync for HotConfigActivator<C>
impl<C> Unpin for HotConfigActivator<C>
impl<C> UnsafeUnpin for HotConfigActivator<C>
impl<C> UnwindSafe for HotConfigActivator<C>where
C: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request