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

Unified Diff: sdk/lib/async/stream.dart

Issue 301193010: Update documentation for "close". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « no previous file | sdk/lib/async/stream_controller.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index f953a5a276709316157ec34ddb7f7e7ddcd44fa1..c520342ff973918d04c89ce104d4ac1aa7e5d431 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -1338,11 +1338,11 @@ abstract class StreamSubscription<T> {
* An interface that abstracts creation or handling of [Stream] events.
*/
abstract class EventSink<T> implements Sink<T> {
- /** Create a data event */
+ /** Create a data event on the stream. */
void add(T event);
- /** Create an async error. */
+ /** Create an async error on the stream. */
void addError(errorEvent, [StackTrace stackTrace]);
- /** Request a stream to close. */
+ /** Request a stream to close. This should also create a done event.*/
void close();
}
@@ -1387,6 +1387,12 @@ abstract class StreamConsumer<S> {
*/
Future addStream(Stream<S> stream);
+ /**
+ * Tell the consumer that no futher streams will be added.
+ *
+ * Returns a future that is completed when the consumer is done handling
+ * events.
+ */
Future close();
}
@@ -1410,18 +1416,23 @@ abstract class StreamConsumer<S> {
*/
abstract class StreamSink<S> implements StreamConsumer<S>, EventSink<S> {
/**
- * Close the [StreamSink]. It'll return the [done] Future.
+ * Send a done event, as the [EventSink.close].
+ *
+ * Returns a future which is completed when the close operation is complete.
*/
Future close();
/**
- * The [done] Future completes with the same values as [close], except
- * for the following case:
+ * Return a future which is completed when the [StreamSink] is cloed.
+ *
+ * The [done] Future completes with the same value as the future returned
+ * by [close], except for the following case:
*
* * The synchronous methods of [EventSink] were called, resulting in an
* error. If there is no active future (like from an addStream call), the
* [done] future will complete with that error
*/
+ // TODO: What does this mean?
Lasse Reichstein Nielsen 2014/06/02 07:21:51 I've tried to read the previous documentation, and
Future get done;
}
« no previous file with comments | « no previous file | sdk/lib/async/stream_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698