pub struct RecoveryGate { /* private fields */ }Expand description
The one slot per session that background work has to hold.
It is shared rather than per-coordinator: a recovery copy and a worker upgrade both act on a session’s live worker, so only one of them may run at a time, and a foreground lifecycle operation preempts whichever it is.
Implementations§
Source§impl RecoveryGate
impl RecoveryGate
pub fn reserve(self: &Arc<Self>, session_id: &str) -> RecoveryReservation
Sourcepub fn try_start(&self, session_id: &str) -> Option<Arc<AtomicBool>>
pub fn try_start(&self, session_id: &str) -> Option<Arc<AtomicBool>>
Claims the session for background work and returns the cancel flag that
work must watch, or None when other work or a reservation already
holds it.
pub fn finish(&self, session_id: &str)
pub fn subscribe(&self) -> Receiver<BTreeSet<String>>
pub fn is_busy(&self, session_id: &str) -> bool
Sourcepub fn cancel_busy(&self, session_id: &str)
pub fn cancel_busy(&self, session_id: &str)
Asks the in-flight copy for this session, if any, to stop.
Sourcepub fn cancel_all(&self)
pub fn cancel_all(&self)
Asks every in-flight copy to stop, used when a coordinator shuts down.
pub fn busy_sessions(&self) -> BTreeSet<String>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RecoveryGate
impl !RefUnwindSafe for RecoveryGate
impl !UnwindSafe for RecoveryGate
impl Send for RecoveryGate
impl Sync for RecoveryGate
impl Unpin for RecoveryGate
impl UnsafeUnpin for RecoveryGate
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
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.