Skip to main content

PostgresClientKnobs

Trait PostgresClientKnobs 

Source
pub trait PostgresClientKnobs:
    Debug
    + Send
    + Sync {
    // Required methods
    fn connection_pool_max_size(&self) -> usize;
    fn connection_pool_max_wait(&self) -> Option<Duration>;
    fn connection_pool_ttl(&self) -> Duration;
    fn connection_pool_ttl_stagger(&self) -> Duration;
    fn connect_timeout(&self) -> Duration;
    fn tcp_user_timeout(&self) -> Duration;
    fn keepalives_idle(&self) -> Duration;
    fn keepalives_interval(&self) -> Duration;
    fn keepalives_retries(&self) -> u32;
}
Expand description

Configuration knobs for PostgresClient.

Required Methods§

Source

fn connection_pool_max_size(&self) -> usize

Maximum number of connections allowed in a pool.

Source

fn connection_pool_max_wait(&self) -> Option<Duration>

The maximum time to wait to obtain a connection, if any.

Source

fn connection_pool_ttl(&self) -> Duration

Minimum TTL of a connection. It is expected that connections are routinely culled to balance load to the backing store.

Source

fn connection_pool_ttl_stagger(&self) -> Duration

Minimum time between TTLing connections. Helps stagger reconnections to avoid stampeding the backing store.

Source

fn connect_timeout(&self) -> Duration

Time to wait for a connection to be made before retrying.

Source

fn tcp_user_timeout(&self) -> Duration

TCP user timeout for connections.

Source

fn keepalives_idle(&self) -> Duration

Amount of idle time before a TCP keepalive packet is sent on a connection.

Source

fn keepalives_interval(&self) -> Duration

Time interval between TCP keepalive probes.

Source

fn keepalives_retries(&self) -> u32

Maximum number of TCP keepalive probes that will be sent before dropping a connection.

Implementors§