Skip to main content

Mountain/IPC/Enhanced/ConnectionPool/
PoolConfig.rs

1#![allow(non_snake_case)]
2
3//! Connection-pool tunables: max / min connection counts plus
4//! the four millisecond budgets (acquire timeout, max
5//! lifetime, idle timeout, health-check interval).
6
7use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct Struct {
11	pub max_connections:usize,
12	pub min_connections:usize,
13	pub connection_timeout_ms:u64,
14	pub max_lifetime_ms:u64,
15	pub idle_timeout_ms:u64,
16	pub health_check_interval_ms:u64,
17}
18
19impl Default for Struct {
20	fn default() -> Self {
21		Self {
22			max_connections:10,
23			min_connections:2,
24			connection_timeout_ms:30000,
25			max_lifetime_ms:300000,
26			idle_timeout_ms:60000,
27			health_check_interval_ms:30000,
28		}
29	}
30}