From 2cc357f2f2330f08d9681dbec75e2685e60d0460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Wed, 20 Oct 2021 01:21:07 +0200 Subject: [PATCH] aquatic_udp: glommio: spawn request handlers as tasks --- aquatic_udp/src/lib/glommio/handlers.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/aquatic_udp/src/lib/glommio/handlers.rs b/aquatic_udp/src/lib/glommio/handlers.rs index 397faf3..acb2ff5 100644 --- a/aquatic_udp/src/lib/glommio/handlers.rs +++ b/aquatic_udp/src/lib/glommio/handlers.rs @@ -40,18 +40,17 @@ pub async fn run_request_worker( })); for (_, receiver) in request_receivers.streams() { - handle_request_stream( - &config, + spawn_local(handle_request_stream( + config.clone(), torrents.clone(), response_senders.clone(), receiver, - ) - .await; + )).await; } } async fn handle_request_stream( - config: &Config, + config: Config, torrents: Rc>, response_senders: Rc>, mut stream: S,