From 94ebb02f59ceedc2e6e4de9cb15b8f731f9090b7 Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Sun, 25 Jun 2023 20:19:40 +0300 Subject: [PATCH] http: server add async dispose PR-URL: https://github.com/nodejs/node/pull/48548 Reviewed-By: Moshe Atlow Reviewed-By: Paolo Insogna Reviewed-By: Benjamin Gruenbaum Reviewed-By: Matteo Collina --- doc/api/http.md | 12 ++++++++++++ lib/_http_server.js | 7 +++++++ test/parallel/test-http-server-async-dispose.js | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 test/parallel/test-http-server-async-dispose.js diff --git a/doc/api/http.md b/doc/api/http.md index b6fa32a3c0b4cc..5451cb0ccf6f96 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1667,6 +1667,17 @@ to 8.0.0, which did not have a keep-alive timeout. The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections. +### `server[Symbol.asyncDispose]()` + + + +> Stability: 1 - Experimental + +Calls [`server.close()`][] and returns a promise that fulfills when the +server has closed. + ## Class: `http.ServerResponse`