pub enum LifecycleEvent {
Open {
ctx: OpenContext,
reply: Sender<Result<ReplicatorHandle>>,
},
ChangeRole {
new_role: Role,
reply: Sender<Result<String>>,
},
Close {
reply: Sender<Result<()>>,
},
Abort,
}Expand description
Lifecycle events delivered on the lifecycle channel. Rare but high-priority — handle immediately (blocks reconfiguration).
Variants§
Open
Replica opened. Create replicator, return handle to runtime.
The user creates the replicator (e.g., WalReplicator::create()),
keeps the user-facing handles, and returns the ReplicatorHandle
to the runtime.
ChangeRole
Role changed. Start/stop background work accordingly.
Reply with the new listening address (e.g., “http://0.0.0.0:8080”) or empty string if not listening in this role.
Close
Graceful shutdown. Drain in-flight work, flush state, release resources. The runtime calls the replicator’s Close after this returns.
Abort
Ungraceful termination. Release resources best-effort and return immediately. No reply channel — the runtime doesn’t wait.
Auto Trait Implementations§
impl Freeze for LifecycleEvent
impl !RefUnwindSafe for LifecycleEvent
impl Send for LifecycleEvent
impl Sync for LifecycleEvent
impl Unpin for LifecycleEvent
impl UnsafeUnpin for LifecycleEvent
impl !UnwindSafe for LifecycleEvent
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request