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

Side by Side Diff: lib/src/null_stream_sink.dart

Issue 1777453002: Modernize the package's style. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library async.null_stream_sink;
6
7 import 'dart:async'; 5 import 'dart:async';
8 6
9 /// A [StreamSink] that discards all events. 7 /// A [StreamSink] that discards all events.
10 /// 8 ///
11 /// The sink silently drops events until [close] is called, at which point it 9 /// The sink silently drops events until [close] is called, at which point it
12 /// throws [StateError]s when events are added. This is the same behavior as a 10 /// throws [StateError]s when events are added. This is the same behavior as a
13 /// sink whose remote end has closed, such as when a [WebSocket] connection has 11 /// sink whose remote end has closed, such as when a [WebSocket] connection has
14 /// been closed. 12 /// been closed.
15 /// 13 ///
16 /// This can be used when a sink is needed but no events are actually intended 14 /// This can be used when a sink is needed but no events are actually intended
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (_addingStream) { 79 if (_addingStream) {
82 throw new StateError("Cannot add to a sink while adding a stream."); 80 throw new StateError("Cannot add to a sink while adding a stream.");
83 } 81 }
84 } 82 }
85 83
86 Future close() { 84 Future close() {
87 _closed = true; 85 _closed = true;
88 return done; 86 return done;
89 } 87 }
90 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698