OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.async; | 5 part of dart.async; |
6 | 6 |
7 // ------------------------------------------------------------------- | 7 // ------------------------------------------------------------------- |
8 // Core Stream types | 8 // Core Stream types |
9 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
10 | 10 |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 () { | 1298 () { |
1299 subscription.resume(); | 1299 subscription.resume(); |
1300 timer = zone.createTimer(timeLimit, timeout); | 1300 timer = zone.createTimer(timeLimit, timeout); |
1301 }, | 1301 }, |
1302 onCancel); | 1302 onCancel); |
1303 return controller.stream; | 1303 return controller.stream; |
1304 } | 1304 } |
1305 } | 1305 } |
1306 | 1306 |
1307 /** | 1307 /** |
1308 * A subscritption on events from a [Stream]. | 1308 * A subscription on events from a [Stream]. |
1309 * | 1309 * |
1310 * When you listen on a [Stream] using [Stream.listen], | 1310 * When you listen on a [Stream] using [Stream.listen], |
1311 * a [StreamSubscription] object is returned. | 1311 * a [StreamSubscription] object is returned. |
1312 * | 1312 * |
1313 * The subscription provides events to the listener, | 1313 * The subscription provides events to the listener, |
1314 * and holds the callbacks used to handle the events. | 1314 * and holds the callbacks used to handle the events. |
1315 * The subscription can also be used to unsubscribe from the events, | 1315 * The subscription can also be used to unsubscribe from the events, |
1316 * or to temporarily pause the events from the stream. | 1316 * or to temporarily pause the events from the stream. |
1317 */ | 1317 */ |
1318 abstract class StreamSubscription<T> { | 1318 abstract class StreamSubscription<T> { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 class _ControllerEventSinkWrapper<T> implements EventSink<T> { | 1735 class _ControllerEventSinkWrapper<T> implements EventSink<T> { |
1736 EventSink _sink; | 1736 EventSink _sink; |
1737 _ControllerEventSinkWrapper(this._sink); | 1737 _ControllerEventSinkWrapper(this._sink); |
1738 | 1738 |
1739 void add(T data) { _sink.add(data); } | 1739 void add(T data) { _sink.add(data); } |
1740 void addError(error, [StackTrace stackTrace]) { | 1740 void addError(error, [StackTrace stackTrace]) { |
1741 _sink.addError(error, stackTrace); | 1741 _sink.addError(error, stackTrace); |
1742 } | 1742 } |
1743 void close() { _sink.close(); } | 1743 void close() { _sink.close(); } |
1744 } | 1744 } |
OLD | NEW |