Chromium Code Reviews| 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; |
| } |