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
13	pub min_connections:usize,
14
15	pub connection_timeout_ms:u64,
16
17	pub max_lifetime_ms:u64,
18
19	pub idle_timeout_ms:u64,
20
21	pub health_check_interval_ms:u64,
22}
23
24impl Default for Struct {
25	fn default() -> Self {
26		Self {
27			max_connections:10,
28
29			min_connections:2,
30
31			connection_timeout_ms:30000,
32
33			max_lifetime_ms:300000,
34
35			idle_timeout_ms:60000,
36
37			health_check_interval_ms:30000,
38		}
39	}
40}