pub struct RecoveryObserver {
pub gate: Arc<RecoveryGate>,
/* private fields */
}Expand description
Reports session activity to the recovery coordinator.
Reporting retains only the newest observation per session. Completed-turn frontiers are merged monotonically, so coalescing does not lose the boundary that makes a recovery copy due.
A caller that must know no copy can start uses RecoveryObserver::reserve
rather than the queue: the reservation blocks a copy from starting whether
or not queued observations have been read yet.
Fields§
§gate: Arc<RecoveryGate>Implementations§
Source§impl RecoveryObserver
impl RecoveryObserver
Sourcepub fn observe(&self, observation: RecoveryObservation)
pub fn observe(&self, observation: RecoveryObservation)
Queues one observation for the coordinator. Returns as soon as the observation is queued; a stopped coordinator makes this a no-op.
pub fn is_busy(&self, session_id: &str) -> bool
Sourcepub fn reserve(&self, session_id: &str) -> RecoveryReservation
pub fn reserve(&self, session_id: &str) -> RecoveryReservation
Holds off any recovery copy for this session until the returned reservation is dropped. This, not the observation queue, is what a lifecycle operation relies on: queued observations may still be unread, and the coordinator refuses to start a copy for a reserved session whenever it reads them.
Sourcepub fn cancel_busy(&self, session_id: &str)
pub fn cancel_busy(&self, session_id: &str)
Asks an in-flight recovery copy for this session to stop. A foreground lifecycle operation calls this after reserving so it preempts the copy instead of waiting behind it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RecoveryObserver
impl !UnwindSafe for RecoveryObserver
impl Freeze for RecoveryObserver
impl Send for RecoveryObserver
impl Sync for RecoveryObserver
impl Unpin for RecoveryObserver
impl UnsafeUnpin for RecoveryObserver
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> 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