pub struct RefreshManager { /* private fields */ }Expand description
Refresh manager combining trigger and job coordination
Implementations§
Source§impl RefreshManager
impl RefreshManager
Sourcepub fn new(config: RefreshConfig) -> Self
pub fn new(config: RefreshConfig) -> Self
Create new refresh manager
Sourcepub fn check_and_trigger(&self, ttl_consumed_percent: u32) -> bool
pub fn check_and_trigger(&self, ttl_consumed_percent: u32) -> bool
Check if refresh should trigger and mark pending
Sourcepub fn complete_job_success(&self) -> Result<(), String>
pub fn complete_job_success(&self) -> Result<(), String>
Complete refresh job successfully
Sourcepub fn complete_job_failure(
&self,
error: impl Into<String>,
) -> Result<(), String>
pub fn complete_job_failure( &self, error: impl Into<String>, ) -> Result<(), String>
Complete refresh job with failure
Sourcepub fn trigger(&self) -> Arc<RefreshTrigger>
pub fn trigger(&self) -> Arc<RefreshTrigger>
Get refresh trigger
Sourcepub fn job(&self) -> Arc<RefreshJob>
pub fn job(&self) -> Arc<RefreshJob>
Get refresh job
Sourcepub fn refresh_pending(&self) -> bool
pub fn refresh_pending(&self) -> bool
Check if refresh is needed and pending
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if automatic refresh enabled
Sourcepub fn trigger_manual(&self) -> Result<(), String>
pub fn trigger_manual(&self) -> Result<(), String>
Manually trigger refresh (bypass TTL check)
Sourcepub fn request_shutdown(&self)
pub fn request_shutdown(&self)
Request job shutdown
Sourcepub fn time_since_last_check(&self) -> Option<Duration>
pub fn time_since_last_check(&self) -> Option<Duration>
Get time since last check
Sourcepub fn time_since_last_refresh(&self) -> Option<Duration>
pub fn time_since_last_refresh(&self) -> Option<Duration>
Get time since last refresh
Sourcepub fn job_running(&self) -> bool
pub fn job_running(&self) -> bool
Check if job is currently running
Sourcepub fn job_success_rate_percent(&self) -> u32
pub fn job_success_rate_percent(&self) -> u32
Get job success rate percentage
Sourcepub fn health_status(&self) -> RefreshHealthStatus
pub fn health_status(&self) -> RefreshHealthStatus
Get health status of refresh system
Sourcepub fn should_retry_refresh(&self) -> bool
pub fn should_retry_refresh(&self) -> bool
Check if should retry refresh (has pending but not max retries)
Sourcepub fn reset_for_retry(&self)
pub fn reset_for_retry(&self)
Reset refresh state for retry
Trait Implementations§
Source§impl Clone for RefreshManager
impl Clone for RefreshManager
Source§fn clone(&self) -> RefreshManager
fn clone(&self) -> RefreshManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefreshManager
impl Debug for RefreshManager
Auto Trait Implementations§
impl Freeze for RefreshManager
impl RefUnwindSafe for RefreshManager
impl Send for RefreshManager
impl Sync for RefreshManager
impl Unpin for RefreshManager
impl UnwindSafe for RefreshManager
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
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>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().