From b84f745b276009cca1f120dbd70e9de59b842965 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 | 9 +++++++++ test/parallel/test-http-server-async-dispose.js | 14 ++++++++++++++ 3 files changed, 35 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 10909e8ebaa913..82c2e4909d0a10 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1652,6 +1652,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`