Remove blocking code and spawn_blocking

Rayhunter uses a mixture of spawn and spawn_blocking, then also does
some blocking operations inside of async code.

Move everything to async. This allows us to use the single-threaded
runtime.

Now the binary is 100kB smaller, and the memory usage also improved by
~100kB on tplink.
This commit is contained in:
Markus Unterwaditzer
2025-07-25 14:18:44 +02:00
committed by Will Greenberg
parent 9694aa826b
commit f8824ce7e7
10 changed files with 88 additions and 77 deletions

View File

@@ -182,7 +182,7 @@ fn run_shutdown_thread(
})
}
#[tokio::main]
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), RayhunterError> {
env_logger::init();