#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RuntimeConfig {
pub bus_capacity: usize,
pub worker_threads: usize,
pub thread_name: &'static str,
}
impl Default for RuntimeConfig {
fn default() -> Self {
Self {
bus_capacity: 4_096,
worker_threads: std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(1),
thread_name: "rust-elm",
}
}
}
impl RuntimeConfig {
pub fn new(bus_capacity: usize) -> Self {
Self {
bus_capacity,
..Self::default()
}
}
}