From 97a58c597023275ed3baa72492a359464c18b517 Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Sun, 25 Jun 2023 23:29:58 +0300 Subject: [PATCH] https: server add `asyncDispose` 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/https.md | 12 ++++++++++++ lib/https.js | 6 ++++++ .../test-https-server-async-dispose.js | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 test/parallel/test-https-server-async-dispose.js diff --git a/doc/api/https.md b/doc/api/https.md index c4dbd898613d6f..c511d8107ff0d4 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -135,6 +135,17 @@ added: v0.1.90 See [`server.close()`][] in the `node:http` module. +### `server[Symbol.asyncDispose]()` + + + +> Stability: 1 - Experimental + +Calls [`server.close()`][httpsServerClose] and returns a promise that +fulfills when the server has closed. + ### `server.closeAllConnections()`