From 3ecc60703b489cb37aeae0962ec9eef37769145c Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Sun, 25 Jun 2023 23:19:38 +0300 Subject: [PATCH] http2: 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/http2.md | 12 ++++++++++++ lib/internal/http2/core.js | 5 +++++ test/parallel/test-http2-server-async-dispose.js | 15 +++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 test/parallel/test-http2-server-async-dispose.js diff --git a/doc/api/http2.md b/doc/api/http2.md index 518990a2e9cb8c..d0d019e0040273 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2070,6 +2070,17 @@ If `callback` is provided, it is not invoked until all active sessions have been closed, although the server has already stopped allowing new sessions. See [`net.Server.close()`][] for more details. +#### `server[Symbol.asyncDispose]()` + + + +> Stability: 1 - Experimental + +Calls [`server.close()`][] and returns a promise that fulfills when the +server has closed. + #### `server.setTimeout([msecs][, callback])`