pub struct Keeper { /* private fields */ }Expand description
Leases the orchestrator holds for work that is waiting to be integrated: the worker has exited, so nothing else renews them, and a lease that lapsed in the queue would send finished work back to the pool.
Implementations§
Source§impl Keeper
impl Keeper
Sourcepub fn hold(&self, unit: &str, holder: &str, expires: UtcTime)
pub fn hold(&self, unit: &str, holder: &str, expires: UtcTime)
Keep unit’s lease alive from now on.
pub fn stop(&self)
Sourcepub fn renew_due(
&self,
params: &MonitorParams,
clock: &dyn Clock,
backend: &dyn LeaseBackend,
) -> Vec<String>
pub fn renew_due( &self, params: &MonitorParams, clock: &dyn Clock, backend: &dyn LeaseBackend, ) -> Vec<String>
One pass: renew every held lease that is due. Returns the units whose lease turned out to be gone.
Sourcepub fn run(
&self,
params: &MonitorParams,
clock: &dyn Clock,
backend: &dyn LeaseBackend,
)
pub fn run( &self, params: &MonitorParams, clock: &dyn Clock, backend: &dyn LeaseBackend, )
Renew until Keeper::stop, one pass per params.tick.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Keeper
impl Forget for Keeper
impl Move for Keeper
impl RefUnwindSafe for Keeper
impl Send for Keeper
impl Sync for Keeper
impl Unpin for Keeper
impl UnsafeUnpin for Keeper
impl UnwindSafe for Keeper
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