pub struct RcClientConfiguration {
pub kind: ClientKind,
pub poll_interval: Duration,
pub max_backoff: Duration,
pub request_timeout: Duration,
}Expand description
Settings for a RemoteConfigurationClient.
Rc abbreviates Remote Configuration, which avoids the repetition in RemoteConfigurationClientConfiguration.
Start from new, which takes the kind of client to report and uses the standard schedule, and change
fields as needed. validate checks the values, and RemoteConfigurationClient::new
rejects invalid settings.
Whatever the settings, the worker polls once immediately when it starts, and retries every second until its first
successful poll. The exception is an Agent that answers that Remote Configuration is not enabled: the worker then
waits max_backoff between attempts, first success or not.
Fields§
§kind: ClientKindThe kind of client the Agent sees, and the details it reports in every poll.
Has no default.
poll_interval: DurationHow long the worker waits between successful polls.
Shorter intervals deliver changes sooner at the cost of more requests to the Agent. The Agent refreshes from the backend far less often than this, so lowering it rarely helps. Must be at least one second.
Defaults to 5 seconds.
max_backoff: DurationThe longest the worker waits between polls while polls are failing.
After consecutive failures the wait doubles, with jitter, from poll_interval up to this ceiling, and resets
on the next success. The worker also waits this long between attempts when the Agent has remote configuration
disabled. Must be at least poll_interval.
Defaults to 90 seconds.
request_timeout: DurationHow long the worker waits for the Agent to answer one poll.
A poll that runs out of time is abandoned and handled like any other failed poll, so a stuck connection cannot stall delivery indefinitely. The Agent may hold the first poll from a new client for up to about two seconds while it fetches from the backend, so this must stay well above that. Must be at least one second.
Defaults to 30 seconds.
Implementations§
Source§impl RcClientConfiguration
impl RcClientConfiguration
Sourcepub fn new(kind: ClientKind) -> Self
pub fn new(kind: ClientKind) -> Self
Creates settings for a client that reports itself as kind, with the standard schedule.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks that the settings are valid.
§Errors
Returns Error::InvalidSettings if an agent’s name or
version is empty, poll_interval is shorter than one second, max_backoff is
shorter than poll_interval, or request_timeout is shorter than one second. The fields are checked in that
order, and the error describes the first that fails.
Trait Implementations§
Source§impl Clone for RcClientConfiguration
impl Clone for RcClientConfiguration
Source§fn clone(&self) -> RcClientConfiguration
fn clone(&self) -> RcClientConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RcClientConfiguration
impl RefUnwindSafe for RcClientConfiguration
impl Send for RcClientConfiguration
impl Sync for RcClientConfiguration
impl Unpin for RcClientConfiguration
impl UnwindSafe for RcClientConfiguration
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more