Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMaleDong <maledong_github@outlook.com>2018-08-17 05:50:05 +0300
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2018-10-17 02:07:24 +0300
commit3fe9293efc15de80f7338638f2647b4724101beb (patch)
treef76a71273e505b0def06c7bce98a3a13966e8d04 /doc
parent348cde07fd46af3aff58f03597e42f9d5af52844 (diff)
doc: make createPushResponse() more detailled
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. Backport-PR-URL: https://github.com/nodejs/node/pull/22850 PR-URL: https://github.com/nodejs/node/pull/22366 Refs: https://github.com/nodejs/node/issues/22322 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/http2.md16
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md
index cd4edbc6c89..ea53e7c48d5 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -3146,12 +3146,18 @@ will result in a [`TypeError`][] being thrown.
<!-- YAML
added: v8.4.0
-->
+* `headers` {HTTP/2 Headers Object} An object describing the headers
+* `callback` {Function} Called once `http2stream.pushStream()` is finished,
+ or either when the attempt to create the pushed `Http2Stream` has failed or
+ has been rejected, or the state of `Http2ServerRequest` is closed prior to
+ calling the `http2stream.pushStream()` method
+ * `err` {Error}
+ * `stream` {ServerHttp2Stream} The newly-created `ServerHttp2Stream` object
-Call [`http2stream.pushStream()`][] with the given headers, and wraps the
-given newly created [`Http2Stream`] on `Http2ServerResponse`.
-
-The callback will be called with an error with code `ERR_HTTP2_INVALID_STREAM`
-if the stream is closed.
+Call [`http2stream.pushStream()`][] with the given headers, and wrap the
+given [`Http2Stream`] on a newly created `Http2ServerResponse` as the callback
+parameter if successful. When `Http2ServerRequest` is closed, the callback is
+called with an error `ERR_HTTP2_INVALID_STREAM`.
## Collecting HTTP/2 Performance Metrics