From a931a47511f0f1160f2446a543fed867ea59703b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 7 Dec 2023 00:43:01 +0100 Subject: feat: stabilize Deno.HttpServer.shutdown and Unix socket support (#21463) This commit stabilizes "Deno.HttpServer.shutdown" API as well as Unix socket support in "Deno.serve" API. --------- Co-authored-by: Yoshiya Hinosawa --- ext/http/http_next.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'ext') diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs index db63601a0..217ae1c39 100644 --- a/ext/http/http_next.rs +++ b/ext/http/http_next.rs @@ -87,6 +87,11 @@ static USE_WRITEV: Lazy = Lazy::new(|| { false }); +// NOTE(bartlomieju): currently we don't have any unstable HTTP features, +// but let's keep this const here, because: +// a) we still need to support `--unstable-http` flag to not break user's CLI; +// b) we might add more unstable features in the future. +#[allow(dead_code)] pub const UNSTABLE_FEATURE_NAME: &str = "http"; /// All HTTP/2 connections start with this byte string. @@ -1183,16 +1188,6 @@ pub async fn op_http_close( if graceful { http_general_trace!("graceful shutdown"); - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` - state - .borrow() - .feature_checker - .check_or_exit_with_legacy_fallback( - UNSTABLE_FEATURE_NAME, - "Deno.Server.shutdown", - ); - // In a graceful shutdown, we close the listener and allow all the remaining connections to drain join_handle.listen_cancel_handle().cancel(); poll_fn(|cx| join_handle.server_state.poll_complete(cx)).await; -- cgit v1.2.3