Skip to content

Commit

Permalink
doc: make createPushResponse() more detailled
Browse files Browse the repository at this point in the history
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: #22850
PR-URL: #22366
Refs: #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>
  • Loading branch information
MaleDong authored and BethGriggs committed Oct 16, 2018
1 parent 348cde0 commit 3fe9293
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3fe9293

Please sign in to comment.