From 81f630fd53cbb441a12fe7177a40eb479a6c0711 Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Sun, 25 Jun 2023 20:19:40 +0300 Subject: [PATCH 1/6] http: server add async dispose --- doc/api/http.md | 12 ++++++++++++ lib/_http_server.js | 6 ++++++ test/parallel/test-http-server-async-dispose.js | 14 ++++++++++++++ 3 files changed, 32 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` + +> Stability: 1 - Experimental + +Calls [`server.close()`][] and returns a promise that fulfills when the +server has closed. + #### `server.setTimeout([msecs][, callback])` + +> Stability: 1 - Experimental + +Calls [`server.close()`][httpsServerClose] and returns a promise that fulfills when the +server has closed. + ### `server.closeAllConnections()`