pub struct RemoteConfigurationClient { /* private fields */ }Expand description
A cloneable handle for subscribing to Remote Configuration products.
Every clone shares one set of subscriptions and one client identity with the worker.
Implementations§
Source§impl RemoteConfigurationClient
impl RemoteConfigurationClient
Sourcepub fn new(
ra: RemoteAgentClient,
config: RcClientConfiguration,
) -> Result<(Self, RemoteConfigurationWorker)>
pub fn new( ra: RemoteAgentClient, config: RcClientConfiguration, ) -> Result<(Self, RemoteConfigurationWorker)>
Creates a client and its worker from a connected Datadog Agent client.
The connection must be dedicated to Remote Configuration rather than a clone of another subsystem’s client,
following the Saluki pattern of one connection per subsystem. The connection type is cloneable, so nothing here
enforces that; it is a convention of the caller’s wiring. Construction does not spawn the worker or probe
Remote Configuration availability; the caller schedules the worker through a supervisor or its run method.
The client identifies itself to the Agent with a random ID, generated here and kept for the life of the client,
and with the kind and details in config.
§Errors
Returns an error if config fails RcClientConfiguration::validate.
Sourcepub fn subscribe<P>(&self) -> Result<Subscription<P::Snapshot, P::Error>>where
P: ProductDecoder,
pub fn subscribe<P>(&self) -> Result<Subscription<P::Snapshot, P::Error>>where
P: ProductDecoder,
Subscribes to the product P decodes, P::PRODUCT.
The decoder is named here, where how a product is read is the subject; the returned subscription is typed by the snapshot that decoder builds. Subscriptions can be added while the worker runs.
A product may have only one live subscription per client, even when two decoders name it. Several consumers of
one product therefore share a single Subscription by cloning it, rather than each subscribing for
themselves. Dropping the last clone unsubscribes, after which the product may be subscribed again.
The new subscription starts with no accepted snapshot.
Subscribing wakes the worker to poll without waiting for its next scheduled poll. The Agent answers polls from a cache that it refreshes from the Datadog backend on its own schedule, every minute by default. It refreshes early only for a client it has not seen before, so a product that no other client of the Agent requests, subscribed after this client’s first poll, may take up to the Agent’s refresh interval to arrive.
§Errors
Returns Error::AlreadySubscribed when the product still has a live subscription on this client, which
indicates that the caller should be receiving a clone of the existing subscription instead.
Trait Implementations§
Source§impl Clone for RemoteConfigurationClient
impl Clone for RemoteConfigurationClient
Source§fn clone(&self) -> RemoteConfigurationClient
fn clone(&self) -> RemoteConfigurationClient
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 RemoteConfigurationClient
impl RefUnwindSafe for RemoteConfigurationClient
impl Send for RemoteConfigurationClient
impl Sync for RemoteConfigurationClient
impl Unpin for RemoteConfigurationClient
impl UnwindSafe for RemoteConfigurationClient
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