From 57c1129508092d50ff12759360f85ff681d83574 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 10 Jul 2020 16:56:22 -0700 Subject: [PATCH] quic: implement QuicSession close as promise PR-URL: https://github.com/nodejs/node/pull/34283 Reviewed-By: Anna Henningsen --- doc/api/quic.md | 9 +-- lib/internal/quic/core.js | 151 +++++++++++++++++++------------------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index d362e55328b933..56dc1f2bff9538 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -352,7 +352,7 @@ Binds the `QuicEndpoint` if it has not already been bound. User code will not typically be responsible for binding a `QuicEndpoint` as the owning `QuicSocket` will do that automatically. -* `options` {object} +* `options` {Object} * `signal` {AbortSignal} Optionally allows the `bind()` to be canceled using an `AbortController`. * Returns: {Promise} @@ -821,17 +821,16 @@ added: REPLACEME Information about the cipher algorithm selected for the session. -#### quicsession.close(\[callback\]) +#### quicsession.close() -* `callback` {Function} Callback invoked when the close operation is completed - Begins a graceful close of the `QuicSession`. Existing `QuicStream` instances will be permitted to close naturally. New `QuicStream` instances will not be permitted. Once all `QuicStream` instances have closed, the `QuicSession` -instance will be destroyed. +instance will be destroyed. Returns a `Promise` that is resolved once the +`QuicSession` instance is destroyed. #### quicsession.closeCode