| 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 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 * When this stream is listened to, it will start listening on [stream], | 1657 * When this stream is listened to, it will start listening on [stream], |
| 1658 * and generate events on the new stream based on the events from [stream]. | 1658 * and generate events on the new stream based on the events from [stream]. |
| 1659 * | 1659 * |
| 1660 * Subscriptions on the returned stream should propagate pause state | 1660 * Subscriptions on the returned stream should propagate pause state |
| 1661 * to the subscription on [stream]. | 1661 * to the subscription on [stream]. |
| 1662 */ | 1662 */ |
| 1663 Stream<T> bind(Stream<S> stream); | 1663 Stream<T> bind(Stream<S> stream); |
| 1664 } | 1664 } |
| 1665 | 1665 |
| 1666 /** | 1666 /** |
| 1667 * An [Iterable] like interface for the values of a [Stream]. | 1667 * An [Iterator] like interface for the values of a [Stream]. |
| 1668 * | 1668 * |
| 1669 * This wraps a [Stream] and a subscription on the stream. It listens | 1669 * This wraps a [Stream] and a subscription on the stream. It listens |
| 1670 * on the stream, and completes the future returned by [moveNext] when the | 1670 * on the stream, and completes the future returned by [moveNext] when the |
| 1671 * next value becomes available. | 1671 * next value becomes available. |
| 1672 */ | 1672 */ |
| 1673 abstract class StreamIterator<T> { | 1673 abstract class StreamIterator<T> { |
| 1674 | 1674 |
| 1675 /** Create a [StreamIterator] on [stream]. */ | 1675 /** Create a [StreamIterator] on [stream]. */ |
| 1676 factory StreamIterator(Stream<T> stream) = _StreamIteratorImpl<T>; | 1676 factory StreamIterator(Stream<T> stream) = _StreamIteratorImpl<T>; |
| 1677 | 1677 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 class _ControllerEventSinkWrapper<T> implements EventSink<T> { | 1732 class _ControllerEventSinkWrapper<T> implements EventSink<T> { |
| 1733 EventSink _sink; | 1733 EventSink _sink; |
| 1734 _ControllerEventSinkWrapper(this._sink); | 1734 _ControllerEventSinkWrapper(this._sink); |
| 1735 | 1735 |
| 1736 void add(T data) { _sink.add(data); } | 1736 void add(T data) { _sink.add(data); } |
| 1737 void addError(error, [StackTrace stackTrace]) { | 1737 void addError(error, [StackTrace stackTrace]) { |
| 1738 _sink.addError(error, stackTrace); | 1738 _sink.addError(error, stackTrace); |
| 1739 } | 1739 } |
| 1740 void close() { _sink.close(); } | 1740 void close() { _sink.close(); } |
| 1741 } | 1741 } |
| OLD | NEW |