From 2bacf887c0f3aff01d60dd1255b2d0e673f550ea Mon Sep 17 00:00:00 2001 From: ashelyn ghost Date: Mon, 8 Jul 2024 20:36:06 -0600 Subject: Separate out listener and event handling --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.rs') 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; }) }) -- cgit 1.4.1