From 98d82428b01d4da5d86018a7e998cec09e5c339e Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 14 Nov 2018 14:31:04 +0100 Subject: [PATCH] remove asnyc test code --- src/main.rs | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9e58681a..24f31157 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,35 +96,6 @@ fn get_request_parameters_async<'a>( Box::new(resp) } -fn handle_async_api_request<'a>( - info: &'a ApiMethod, - parts: Parts, - req_body: Body, -) -> Box, Error = failure::Error> + Send + 'a> -{ - let params = get_request_parameters_async(info, parts, req_body); - - let resp = params - .and_then(move |params| { - - println!("GOT PARAMS {}", params); - - /* - let when = Instant::now() + Duration::from_millis(3000); - let task = Delay::new(when).then(|_| { - println!("A LAZY TASK"); - ok(()) - }); - - tokio::spawn(task); - */ - - (info.async_handler)(params, info) - }); - - Box::new(resp) -} - fn handle_sync_api_request<'a>( info: &'a ApiMethod, parts: Parts, @@ -255,7 +226,7 @@ fn handle_request(api: Arc, req: Request) -> BoxFut { if let Some(api_method) = api.find_method(&components[2..], method) { // fixme: handle auth - return handle_async_api_request(api_method, parts, body); + return handle_sync_api_request(api_method, parts, body); } } } else {