Skip to main content

Mountain/IPC/Enhanced/ConnectionPool/
PoolConfig.rs

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