Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: runtime/bin/output_stream.dart

Issue 10832188: Add an OutputStream.closed getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/list_stream_impl.dart ('k') | runtime/bin/socket_stream_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/output_stream.dart
diff --git a/runtime/bin/output_stream.dart b/runtime/bin/output_stream.dart
index cfbf8e51daa28c61ebbb555c7434b1ae3ff1565e..b6c28cccffc407a15cfee51a4744401e93cdec2a 100644
--- a/runtime/bin/output_stream.dart
+++ b/runtime/bin/output_stream.dart
@@ -58,9 +58,9 @@ interface OutputStream {
void flush();
/**
- * Indicate that all data has been written to the output
- * stream. When all data has been written to the communication
- * channel it will be closed.
+ * Signal that no more data will be written to the output stream. When all
+ * buffered data has been written out to the communication channel, the
+ * channel will be closed and the [onClosed] callback will be called.
*/
void close();
@@ -71,6 +71,14 @@ interface OutputStream {
void destroy();
/**
+ * Returns whether the stream has been closed by calling close(). If true, no
+ * more data may be written to the output stream, but there still may be
+ * buffered data that has not been written to the communication channel. The
+ * onClosed handler will only be called once all data has been written out.
+ */
+ bool get closed();
+
+ /**
* Sets the handler that gets called when the internal OS buffers
* have been flushed. This callback can be used to keep the rate of
* writing in sync with the rate the system can write data to the
@@ -79,9 +87,8 @@ interface OutputStream {
void set onNoPendingWrites(void callback());
/**
- * Sets the handler that gets called when the underlying
- * communication channel has been closed and no more data can be
- * send.
+ * Sets the handler that gets called when the underlying communication channel
+ * has been closed and all the buffered data has been sent.
*/
void set onClosed(void callback());
« no previous file with comments | « runtime/bin/list_stream_impl.dart ('k') | runtime/bin/socket_stream_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698