pub struct HealthSync { /* private fields */ }Expand description
Publishes this instance’s health, reads its peers’, and keeps quarantine in step with the global table.
Implementations§
Source§impl HealthSync
impl HealthSync
Sourcepub fn new(
pool: Pool,
health: Arc<HealthStore>,
instance: impl Into<String>,
stale_after: Duration,
) -> Arc<Self> ⓘ
pub fn new( pool: Pool, health: Arc<HealthStore>, instance: impl Into<String>, stale_after: Duration, ) -> Arc<Self> ⓘ
Installs the peer overlay on health. stale_after is how old a
peer’s row may be and still vote.
pub fn instance(&self) -> &str
pub fn view(&self) -> &PeerView
Sourcepub async fn load(&self) -> Result<(), StoreUnavailable>
pub async fn load(&self) -> Result<(), StoreUnavailable>
At startup: seed from this instance’s own row, then adopt the table’s quarantines. The table is the authority here: a local quarantine it lacks was cleared while this instance was away.
Sourcepub async fn sync(&self) -> Result<(), StoreUnavailable>
pub async fn sync(&self) -> Result<(), StoreUnavailable>
One round: publish our row and new quarantines, refresh the peer view, reconcile quarantines.
Sourcepub async fn clear_quarantine(
&self,
provider: &str,
) -> Result<bool, StoreUnavailable>
pub async fn clear_quarantine( &self, provider: &str, ) -> Result<bool, StoreUnavailable>
Clear a quarantine fleet-wide. Returns whether anything was cleared, here or in the table. Peers lift theirs on their next sync.
Auto Trait Implementations§
impl !Freeze for HealthSync
impl !RefUnwindSafe for HealthSync
impl !UnwindSafe for HealthSync
impl Forget for HealthSync
impl Move for HealthSync
impl Send for HealthSync
impl Sync for HealthSync
impl Unpin for HealthSync
impl UnsafeUnpin for HealthSync
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