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

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

Issue 12610006: Renamed StreamSink to EventSink. Renamed signalError to addError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
Index: sdk/lib/async/collection_sink.dart
diff --git a/sdk/lib/async/collection_sink.dart b/sdk/lib/async/collection_sink.dart
index a023fd1d0bbae6abd9fdfd7096c74ed830530511..2e8fcd3c93acf27b2520d26265fb4d7f51b55116 100644
--- a/sdk/lib/async/collection_sink.dart
+++ b/sdk/lib/async/collection_sink.dart
@@ -7,8 +7,8 @@ part of dart.async;
typedef void _CollectionSinkCallback<T>(Collection<T> collection);
typedef void _CollectionSinkErrorCallback(AsyncError error);
-/** StreamSink that stores incoming data in a collection. */
-class CollectionSink<T> implements StreamSink<T> {
+/** EventSink that stores incoming data in a collection. */
+class CollectionSink<T> implements EventSink<T> {
final Collection<T> collection;
final _CollectionSinkCallback<T> _callback;
final _CollectionSinkErrorCallback _errorCallback;
@@ -33,11 +33,15 @@ class CollectionSink<T> implements StreamSink<T> {
collection.add(value);
}
- void signalError(AsyncError error) {
+ void addError(AsyncError error) {
if (_isClosed) throw new StateError("Singalling error on closed sink");
floitsch 2013/03/07 14:19:34 Signalling
Lasse Reichstein Nielsen 2013/03/08 10:18:25 Reworded to say "Adding".
if (_errorCallback != null) _errorCallback(error);
}
+ void signalError(AsyncError error) {
+ addError(error);
+ }
+
void close() {
if (_isClosed) throw new StateError("Closing closed sink");
_isClosed = true;

Powered by Google App Engine
This is Rietveld 408576698