use std::time::Duration;
#[derive(Debug, Clone)]
pub struct RpcConfig {
pub thread_num: Option<usize>,
pub max_send_msg_len: i32,
pub max_recv_msg_len: i32,
pub keep_alive_interval: Duration,
pub keep_alive_timeout: Duration,
pub keep_alive_while_idle: bool,
pub default_write_timeout: Duration,
pub default_sql_query_timeout: Duration,
pub connect_timeout: Duration,
}
impl Default for RpcConfig {
fn default() -> Self {
Self {
thread_num: None,
max_send_msg_len: 20 * (1 << 20),
max_recv_msg_len: 1 << 30,
keep_alive_interval: Duration::from_secs(60 * 10),
keep_alive_timeout: Duration::from_secs(3),
keep_alive_while_idle: true,
default_write_timeout: Duration::from_secs(5),
default_sql_query_timeout: Duration::from_secs(60),
connect_timeout: Duration::from_secs(3),
}
}
}