pub struct StaleSweeper {
handle: JoinHandle<()>,
stop: Arc<Notify>,
}Expand description
A running sweep, stopped by StaleSweeper::stop or by dropping it.
Fields§
§handle: JoinHandle<()>§stop: Arc<Notify>Implementations§
Source§impl StaleSweeper
impl StaleSweeper
Sourcepub fn spawn(registry: Arc<dyn StaleSweep>, schedule: SweepSchedule) -> Self
pub fn spawn(registry: Arc<dyn StaleSweep>, schedule: SweepSchedule) -> Self
Starts sweeping registry on schedule.
The first tick fires immediately, so a process that has just come back from the crash that stranded an account starts reaping at once. That pass runs alongside serving.
The sweep itself runs on a blocking thread: it takes the same write lock every write path takes, and a task doing that on a runtime worker holds the worker for the duration. That is also what makes a panicking sweep survivable — the panic arrives here as a join error, is logged, and the next tick tries again rather than the timer dying with it.
Trait Implementations§
Source§impl Drop for StaleSweeper
impl Drop for StaleSweeper
Auto Trait Implementations§
impl Freeze for StaleSweeper
impl RefUnwindSafe for StaleSweeper
impl Send for StaleSweeper
impl Sync for StaleSweeper
impl Unpin for StaleSweeper
impl UnsafeUnpin for StaleSweeper
impl UnwindSafe for StaleSweeper
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more