Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc: Make createPushResponse() more detailled.
Ref: #22322

In summary:
We don't know what will return when successful or failure for
the callback of the function. So make it more detailled.
  • Loading branch information
MaleDong committed Aug 23, 2018
commit 2dc6dce6d095d0cf7a37184431c4efdd1a97f004
16 changes: 10 additions & 6 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3150,13 +3150,17 @@ will result in a [`TypeError`][] being thrown.
added: v8.4.0
-->
* `headers` {HTTP/2 Headers Object} An object describing the headers
* `callback` {Function}

Call [`http2stream.pushStream()`][] with the given headers, and wraps the
given newly created [`Http2Stream`] on `Http2ServerResponse`.
* `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

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