slack_morphism/socket_mode/
config.rs

1use rsb_derive::Builder;
2
3#[derive(Debug, PartialEq, Eq, Clone, Builder)]
4pub struct SlackClientSocketModeConfig {
5    #[default = "SlackClientSocketModeConfig::DEFAULT_CONNECTIONS_COUNT"]
6    pub max_connections_count: u32,
7
8    #[default = "SlackClientSocketModeConfig::DEFAULT_DEBUG_CONNECTIONS"]
9    pub debug_connections: bool,
10
11    #[default = "SlackClientSocketModeConfig::DEFAULT_INITIAL_BACKOFF_IN_SECONDS"]
12    pub initial_backoff_in_seconds: u64,
13
14    #[default = "SlackClientSocketModeConfig::DEFAULT_RECONNECT_TIMEOUT_IN_SECONDS"]
15    pub reconnect_timeout_in_seconds: u64,
16
17    #[default = "SlackClientSocketModeConfig::DEFAULT_PING_INTERVAL_IN_SECONDS"]
18    pub ping_interval_in_seconds: u64,
19
20    #[default = "SlackClientSocketModeConfig::DEFAULT_PING_FAILURE_THRESHOLD_TIMES"]
21    pub ping_failure_threshold_times: u64,
22}
23
24impl SlackClientSocketModeConfig {
25    pub const DEFAULT_CONNECTIONS_COUNT: u32 = 2;
26
27    pub const DEFAULT_DEBUG_CONNECTIONS: bool = false;
28
29    pub const DEFAULT_INITIAL_BACKOFF_IN_SECONDS: u64 = 5;
30
31    pub const DEFAULT_RECONNECT_TIMEOUT_IN_SECONDS: u64 = 30;
32
33    pub const DEFAULT_PING_INTERVAL_IN_SECONDS: u64 = 15;
34
35    pub const DEFAULT_PING_FAILURE_THRESHOLD_TIMES: u64 = 5;
36}