Struct conjure_runtime::ClientFactory[][src]

pub struct ClientFactory { /* fields omitted */ }

A factory type which can create clients that will live-reload in response to configuration updates.

Implementations

impl ClientFactory[src]

pub fn new(config: Refreshable<ServicesConfig, Error>) -> ClientFactory[src]

Creates a new client factory based off of a refreshable ServicesConfig.

pub fn user_agent(&mut self, user_agent: UserAgent) -> &mut Self[src]

Sets the user agent sent by clients.

Required.

pub fn get_user_agent(&self) -> Option<&UserAgent>[src]

Returns the configured user agent.

pub fn client_qos(&mut self, client_qos: ClientQos) -> &mut Self[src]

Sets clients’ rate limiting behavior.

Defaults to ClientQos::Enabled.

pub fn get_client_qos(&self) -> ClientQos[src]

Returns the configured rate limiting behavior

pub fn server_qos(&mut self, server_qos: ServerQos) -> &mut Self[src]

Sets clients’ behavior in response to a QoS error from the server.

Defaults to ServerQos::AutomaticRetry.

pub fn get_server_qos(&self) -> ServerQos[src]

Returns the configured QoS behavior.

pub fn service_error(&mut self, service_error: ServiceError) -> &mut Self[src]

Sets clients’ behavior in response to a service error from the server.

Defaults to ServiceError::WrapInNewError.

pub fn get_service_error(&self) -> ServiceError[src]

Returns the configured service error behavior.

pub fn idempotency(&mut self, idempotency: Idempotency) -> &mut Self[src]

Sets clients’ behavior to determine if a request is idempotent or not.

Only idempotent requests will be retried.

Defaults to Idempotency::ByMethod.

pub fn get_idempotency(&self) -> Idempotency[src]

Returns the configured idempotency behavior.

pub fn node_selection_strategy(
    &mut self,
    node_selection_strategy: NodeSelectionStrategy
) -> &mut Self
[src]

Sets the clients’ strategy for selecting a node for a request.

Defaults to NodeSelectionStrategy::PinUntilError.

pub fn get_node_selection_strategy(&self) -> NodeSelectionStrategy[src]

Returns the configured node selection strategy.

pub fn metrics(&mut self, metrics: Arc<MetricRegistry>) -> &mut Self[src]

Sets the metric registry used to register client metrics.

Defaults to no registry.

pub fn get_metrics(&self) -> Option<&Arc<MetricRegistry>>[src]

Returns the configured metrics registry.

pub fn host_metrics(
    &mut self,
    host_metrics: Arc<HostMetricsRegistry>
) -> &mut Self
[src]

Sets the host metrics registry used to track host performance.

Defaults to no registry.

pub fn get_host_metrics(&self) -> Option<&Arc<HostMetricsRegistry>>[src]

Returns the configured host metrics registry.

pub fn client(&self, service: &str) -> Result<Client, Error>[src]

Creates a new client for the specified service.

The client’s configuration will automatically refresh to track changes in the factory’s ServicesConfig.

If no configuration is present for the specified service in the ServicesConfig, the client will immediately return an error for all requests.

Panics

Panics if user_agent is not set.

pub fn blocking_client(&self, service: &str) -> Result<Client, Error>[src]

Creates a new blocking client for the specified service.

The client’s configuration will automatically refresh to track changes in the factory’s ServicesConfig.

If no configuration is present for the specified service in the ServicesConfig, the client will immediately return an error for all requests.

Panics

Panics if user_agent is not set.

Trait Implementations

impl Clone for ClientFactory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,