summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-08-02 08:09:06 +0200
committerRich Trott <rtrott@gmail.com>2019-08-17 00:28:06 -0700
commit6f613d8abb05619e35c828b665a76215861bbf04 (patch)
tree18a904d44299c6564c5c83adc0051076f27bb922 /doc
parente4bbbcc84bd10be1e9e8e66d42542c70c1a02056 (diff)
downloadandroid-node-v8-6f613d8abb05619e35c828b665a76215861bbf04.tar.gz
android-node-v8-6f613d8abb05619e35c828b665a76215861bbf04.tar.bz2
android-node-v8-6f613d8abb05619e35c828b665a76215861bbf04.zip
http,stream: add writableEnded
This is work towards resolving the response.finished confusion and future deprecation. Note that implementation-wise, streams have both an ending and ended state. However, in this case (in order to avoid confusion in user space) writableEnded is equal to writable.ending. The ending vs ended situation is internal state required for internal stream logic. PR-URL: https://github.com/nodejs/node/pull/28934 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/http.md34
-rw-r--r--doc/api/http2.md12
-rw-r--r--doc/api/stream.md13
3 files changed, 59 insertions, 0 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index 4923b6a61d..d5851b61db 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -764,6 +764,27 @@ req.once('response', (res) => {
});
```
+### request.writableEnded
+<!-- YAML
+added: REPLACEME
+-->
+
+* {boolean}
+
+Is `true` after [`request.end()`][] has been called. This property
+does not indicate whether the data has been flushed, for this use
+[`request.writableFinished`][] instead.
+
+### request.writableFinished
+<!-- YAML
+added: v12.7.0
+-->
+
+* {boolean}
+
+Is `true` if all data has been flushed to the underlying system, immediately
+before the [`'finish'`][] event is emitted.
+
### request.write(chunk[, encoding][, callback])
<!-- YAML
added: v0.1.29
@@ -1436,6 +1457,17 @@ response.statusMessage = 'Not found';
After response header was sent to the client, this property indicates the
status message which was sent out.
+### response.writableEnded
+<!-- YAML
+added: REPLACEME
+-->
+
+* {boolean}
+
+Is `true` after [`response.end()`][] has been called. This property
+does not indicate whether the data has been flushed, for this use
+[`response.writableFinished`][] instead.
+
### response.writableFinished
<!-- YAML
added: v12.7.0
@@ -2222,11 +2254,13 @@ not abort the request or do anything besides add a `'timeout'` event.
[`request.setTimeout()`]: #http_request_settimeout_timeout_callback
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
[`request.socket`]: #http_request_socket
+[`request.writableFinished`]: #http_request_writablefinished
[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback
[`response.end()`]: #http_response_end_data_encoding_callback
[`response.getHeader()`]: #http_response_getheader_name
[`response.setHeader()`]: #http_response_setheader_name_value
[`response.socket`]: #http_response_socket
+[`response.writableFinished`]: #http_response_writablefinished
[`response.write()`]: #http_response_write_chunk_encoding_callback
[`response.write(data, encoding)`]: #http_response_write_chunk_encoding_callback
[`response.writeContinue()`]: #http_response_writecontinue
diff --git a/doc/api/http2.md b/doc/api/http2.md
index 1022eeb913..8a92aad421 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -3271,6 +3271,17 @@ added: v8.4.0
The [`Http2Stream`][] object backing the response.
+#### response.writableEnded
+<!-- YAML
+added: REPLACEME
+-->
+
+* {boolean}
+
+Is `true` after [`response.end()`][] has been called. This property
+does not indicate whether the data has been flushed, for this use
+[`writable.writableFinished`][] instead.
+
#### response.write(chunk[, encoding][, callback])
<!-- YAML
added: v8.4.0
@@ -3510,3 +3521,4 @@ following additional properties:
[`tls.connect()`]: tls.html#tls_tls_connect_options_callback
[`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener
[error code]: #error_codes
+[`writable.writableFinished`]: stream.html#stream_writable_writablefinished
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 07755e05dc..14f5a9032e 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -494,6 +494,17 @@ added: v11.4.0
Is `true` if it is safe to call [`writable.write()`][stream-write].
+##### writable.writableEnded
+<!-- YAML
+added: REPLACEME
+-->
+
+* {boolean}
+
+Is `true` after [`writable.end()`][] has been called. This property
+does not indicate whether the data has been flushed, for this use
+[`writable.writableFinished`][] instead.
+
##### writable.writableFinished
<!-- YAML
added: v12.6.0
@@ -2707,7 +2718,9 @@ contain multi-byte characters.
[`stream.unpipe()`]: #stream_readable_unpipe_destination
[`stream.wrap()`]: #stream_readable_wrap_stream
[`writable.cork()`]: #stream_writable_cork
+[`writable.end()`]: #stream_writable_end_chunk_encoding_callback
[`writable.uncork()`]: #stream_writable_uncork
+[`writable.writableFinished`]: #stream_writable_writablefinished
[`zlib.createDeflate()`]: zlib.html#zlib_zlib_createdeflate_options
[API for Stream Consumers]: #stream_api_for_stream_consumers
[API for Stream Implementers]: #stream_api_for_stream_implementers