diff options
author | ashelyn ghost <git@ashen.earth> | 2024-07-08 20:36:06 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2024-07-08 20:36:06 -0600 |
commit | 2bacf887c0f3aff01d60dd1255b2d0e673f550ea (patch) | |
tree | ff9ae462a57ed3e3ea4f40a4e1829cc045d66b8a /src/main.rs | |
parent | f7058336fbad943b2bcc03716c998abe3fd912ec (diff) |
Separate out listener and event handling
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index a63c4bd..e29f691 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod config; mod system; +mod listener; use std::thread::{self, JoinHandle}; use tokio::runtime; @@ -11,11 +12,10 @@ fn main() { let config = config::Config::load(config_str.to_string()); let handles : Vec<_> = config.systems.into_iter().map(|(system_name, system_config)| -> JoinHandle<()> { - println!("Starting thread for system {}", system_name); thread::spawn(move || { let runtime = runtime::Builder::new_current_thread().enable_all().build().expect("Could not construct Tokio runtime"); runtime.block_on(async { - let mut system = System::new(system_config); + let mut system = System::new(system_name, system_config); system.start_clients().await; }) }) |