Skip to content
Closed
Changes from 1 commit
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
Next Next commit
doc: improve callback documentation of http2Stream.pushstream()
Improve documentation of callback signature of
http2Stream.pushStream() function to align with
the changes made in #17406.

Fixes: #18198
Refs: #17406
  • Loading branch information
Peter Dalgaard-Jensen committed Jan 19, 2018
commit 0adb700fd80f6a8d2b6f99f518c934b3a14a9602
8 changes: 5 additions & 3 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,10 @@ added: v8.4.0
**Default:** `false`
* `parent` {number} Specifies the numeric identifier of a stream the newly
created stream is dependent on.
* `callback` {Function} Callback that is called once the push stream has been
initiated.
* `callback` {Function} Callback that is called once the push stream has been initiated.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please wrap lines at 80 chars.

* `err` {Error}
* `pushStream` {[`ServerHttp2Stream`][]} The returned pushStream object.
* `headers` {[Headers Object][]} Headers object the pushStream was initiated with.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit: this line also needs wrapping (currently 84 characters).

Sorry for the pettiness) This can be fixed by a commit lander if it is not convenient for you to amend the commit or push more commits)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's all good. My first pr, so I'm here to learn.

* Returns: {undefined}

Initiates a push stream. The callback is invoked with the new `Http2Stream`
Expand All @@ -1210,7 +1212,7 @@ const http2 = require('http2');
const server = http2.createServer();
server.on('stream', (stream) => {
stream.respond({ ':status': 200 });
stream.pushStream({ ':path': '/' }, (err, pushStream) => {
stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {
if (err) throw err;
pushStream.respond({ ':status': 200 });
pushStream.end('some pushed data');
Expand Down