rust_elm/runtime/
config.rs1#[derive(Debug, Clone, PartialEq, Eq)]
3pub struct RuntimeConfig {
4 pub bus_capacity: usize,
6 pub worker_threads: usize,
8 pub thread_name: &'static str,
10}
11
12impl Default for RuntimeConfig {
13 fn default() -> Self {
14 Self {
15 bus_capacity: 4_096,
16 worker_threads: std::thread::available_parallelism()
17 .map(|n| n.get())
18 .unwrap_or(1),
19 thread_name: "rust-elm",
20 }
21 }
22}
23
24impl RuntimeConfig {
25 pub fn new(bus_capacity: usize) -> Self {
27 Self {
28 bus_capacity,
29 ..Self::default()
30 }
31 }
32}