From 9d48b5dc549e6fa99f2060280b175f2d3909f546 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Sun, 1 May 2016 00:58:16 -0700 Subject: [PATCH 1/8] Add 'close' events to fs.ReadStream and fs.WriteSTream --- doc/api/fs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 5d73c38fe2e0e8..73d3d0a7ed23b3 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -151,6 +151,10 @@ Stop watching for changes on the given `fs.FSWatcher`. Emitted when the ReadStream's file is opened. +### Event: 'close' + +Emitted when a ReadStream's file has ended or closed. Comes from fs.close() method. + ### readStream.path The path to the file the stream is reading from as specified in the first @@ -238,6 +242,10 @@ on Unix systems, it never was. Emitted when the WriteStream's file is opened. +### Event: 'close' + +Emitted when a WriteStream's file has ended or closed. Comes from fs.close() method. + ### writeStream.bytesWritten The number of bytes written so far. Does not include data that is still queued From ff217a8a6c23a3b6d4289d3e2945461af5ac12f9 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Sun, 1 May 2016 01:08:37 -0700 Subject: [PATCH 2/8] Add 'close' event to stream.Writable per Issue #6484 --- doc/api/stream.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index a7478bf3deed3d..57163d4c323ea4 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -572,6 +572,12 @@ Examples of writable streams include: * [TCP sockets][] * [child process stdin][] * [`process.stdout`][], [`process.stderr`][] + +Event: 'close' + +Emitted when the stream and any of its underlying resources (a file descriptor, for example) have been closed. The event indicates that no more events will be emitted, and no further computation will occur. + +Not all streams will emit the 'close' event. #### Event: 'drain' From 827dfcbf8dd3ceb7d38c64be220248922c0ae43c Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Sun, 1 May 2016 01:28:30 -0700 Subject: [PATCH 3/8] Add #### prefix to Event: 'close' and backticks to 'close' similar to stream.Readable event: 'close' section --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 57163d4c323ea4..6fa1bf89996511 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -573,11 +573,11 @@ Examples of writable streams include: * [child process stdin][] * [`process.stdout`][], [`process.stderr`][] -Event: 'close' +#### Event: 'close' Emitted when the stream and any of its underlying resources (a file descriptor, for example) have been closed. The event indicates that no more events will be emitted, and no further computation will occur. -Not all streams will emit the 'close' event. +Not all streams will emit the `'close'` event. #### Event: 'drain' From 57aa9e64c6b023fbcda245355fa6bd94195b7df6 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Sun, 1 May 2016 01:32:47 -0700 Subject: [PATCH 4/8] Add more specifics to 'close' events for fs.ReadStream and fs.WriteStream --- doc/api/fs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 73d3d0a7ed23b3..7bdeb0c086e8b3 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -153,7 +153,7 @@ Emitted when the ReadStream's file is opened. ### Event: 'close' -Emitted when a ReadStream's file has ended or closed. Comes from fs.close() method. +Emitted when the ReadStream's underlying file descriptor has been closed. Comes from fs.close() method. ### readStream.path @@ -244,7 +244,7 @@ Emitted when the WriteStream's file is opened. ### Event: 'close' -Emitted when a WriteStream's file has ended or closed. Comes from fs.close() method. +Emitted when the ReadStream's underlying file descriptor has been closed. Comes from fs.close() method. ### writeStream.bytesWritten From 439df4bc52d923b1daa3d8877b5f61a9f8dc94e7 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Sun, 1 May 2016 01:34:42 -0700 Subject: [PATCH 5/8] Fix/Changed 'close' event from 'fs.ReadStream' to 'fs.WriteStream' --- doc/api/fs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 7bdeb0c086e8b3..a4566de6948bd8 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -244,7 +244,7 @@ Emitted when the WriteStream's file is opened. ### Event: 'close' -Emitted when the ReadStream's underlying file descriptor has been closed. Comes from fs.close() method. +Emitted when the WriteStream's underlying file descriptor has been closed. Comes from fs.close() method. ### writeStream.bytesWritten From b2a0db1478f806dd5c8f03b427da137845625cb9 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Mon, 2 May 2016 10:21:21 -0700 Subject: [PATCH 6/8] wrapped long lines at 80 chars, reworded per Issue #6484 --- doc/api/fs.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index a4566de6948bd8..bf38a3dfce0c5a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -153,7 +153,8 @@ Emitted when the ReadStream's file is opened. ### Event: 'close' -Emitted when the ReadStream's underlying file descriptor has been closed. Comes from fs.close() method. +Emitted when the `ReadStream`'s underlying file descriptor has been closed +using the `fs.close()` method. ### readStream.path @@ -244,7 +245,8 @@ Emitted when the WriteStream's file is opened. ### Event: 'close' -Emitted when the WriteStream's underlying file descriptor has been closed. Comes from fs.close() method. +Emitted when the `WriteStream`'s underlying file descriptor has been closed +using the `fs.close()` method. ### writeStream.bytesWritten From bcc8bd2baf353fe8ffb5710170ccea3781733099 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Mon, 2 May 2016 10:29:31 -0700 Subject: [PATCH 7/8] including the 'close' event as optional --- doc/api/stream.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 6fa1bf89996511..cd84c2eb83bc7e 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -575,9 +575,11 @@ Examples of writable streams include: #### Event: 'close' -Emitted when the stream and any of its underlying resources (a file descriptor, for example) have been closed. The event indicates that no more events will be emitted, and no further computation will occur. +Emitted when the stream and any of its underlying resources (a file descriptor, +for example) have been closed. The event indicates that no more events will be +emitted, and no further computation will occur. -Not all streams will emit the `'close'` event. +Not all streams will emit the `'close'` event as the `'close'` event is optional. #### Event: 'drain' From 8cdf720f856539ab6dbc6db3a4fe620e45b7c489 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Mon, 2 May 2016 10:49:16 -0700 Subject: [PATCH 8/8] add 'close' event as optional in stream.Readable per issue #6484 --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index cd84c2eb83bc7e..7439b726189164 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -160,7 +160,7 @@ Emitted when the stream and any of its underlying resources (a file descriptor, for example) have been closed. The event indicates that no more events will be emitted, and no further computation will occur. -Not all streams will emit the `'close'` event. +Not all streams will emit the `'close'` event as the `'close'` event is optional. #### Event: 'data'