[][src]Struct reool::multi_node_pool::Builder

pub struct Builder<T, I> { /* fields omitted */ }

A builder for a MultiNodePool

Methods

impl<T, I> Builder<T, I>[src]

pub fn desired_pool_size(self, v: usize) -> Self[src]

The number of connections the pool should initially have and try to maintain

pub fn checkout_timeout(self, v: Option<Duration>) -> Self[src]

The timeout for a checkout if no specific tinmeout is given with a checkout.

pub fn backoff_strategy(self, v: BackoffStrategy) -> Self[src]

The BackoffStrategy to use when retrying on failures to create new connections

pub fn reservation_limit(self, v: Option<usize>) -> Self[src]

The maximum length of the queue for waiting checkouts when no idle connections are available

pub fn stats_interval(self, v: Duration) -> Self[src]

The interval in which the pool will send statistics to the instrumentation

pub fn min_required_nodes(self, v: usize) -> Self[src]

The minimum required nodes to start

pub fn connect_to<C: IntoConnectionInfo>(
    self,
    connect_to: Vec<C>
) -> Builder<C, I>
[src]

The Redis nodes to connect to

pub fn task_executor(self, executor: TaskExecutor) -> Self[src]

The exucutor to use for spawning tasks. If not set it is assumed that the poolis created on the default runtime.

pub fn update_config_from_environment(
    self,
    prefix: Option<&str>
) -> Result<Builder<T, I>, InitializationError>
[src]

Updates this builder's config(not connect_to) from the environment.

If no prefix is set all the given env key start with REOOL_. Otherwise the prefix is used with an automatically appended _.

  • DESIRED_POOL_SIZE: usize. Omit if you do not want to update the value
  • CHECKOUT_TIMEOUT_MS: u64 or "NONE". Omit if you do not want to update the value
  • RESERVATION_LIMIT: usize or "NONE". Omit if you do not want to update the value
  • STATS_INTERVAL_MS: u64. Omit if you do not want to update the value
  • MIN_REQUIRED_NODES: usize. Omit if you do not want to update the value

pub fn instrumented<II>(self, instrumentation: II) -> Builder<T, II> where
    II: Instrumentation + Send + Sync + 'static, 
[src]

Adds instrumentation to the pool

impl<I> Builder<(), I> where
    I: Instrumentation + Send + Sync + 'static, 
[src]

pub fn update_from_environment(
    self,
    prefix: Option<&str>
) -> Result<Builder<String, I>, InitializationError>
[src]

Updates this builder from the environment.

If no prefix is set all the given env key start with REOOL_. Otherwise the prefix is used with an automatically appended _.

  • DESIRED_POOL_SIZE: usize. Omit if you do not want to update the value
  • CHECKOUT_TIMEOUT_MS: u64 or "NONE". Omit if you do not want to update the value
  • RESERVATION_LIMIT: usize or "NONE". Omit if you do not want to update the value
  • STATS_INTERVAL_MS: u64. Omit if you do not want to update the value
  • MIN_REQUIRED_NODES: usize. Omit if you do not want to update the value
  • CONNECT_TO: [String]. Seperated by ;. MANDATORY

impl<T, I> Builder<T, I> where
    T: IntoConnectionInfo,
    I: Instrumentation + Send + Sync + 'static, 
[src]

pub fn finish(self) -> Result<MultiNodePool, InitializationError>[src]

Build a new MultiNodePool

impl<I> Builder<String, I> where
    I: Instrumentation + Send + Sync + 'static, 
[src]

pub fn finish2(self) -> Result<MultiNodePool, InitializationError>[src]

Build a new MultiNodePool

This is a due to a limitation that IntoConnectionInfo is not implemented for String

Trait Implementations

impl Default for Builder<(), NoInstrumentation>[src]

Auto Trait Implementations

impl<T, I> Send for Builder<T, I> where
    I: Send,
    T: Send

impl<T, I> Sync for Builder<T, I> where
    I: Sync,
    T: Sync

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T