| OLD | NEW |
| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 export 'src/delegating_stream_channel.dart'; | 7 export 'src/delegating_stream_channel.dart'; |
| 8 export 'src/isolate_channel.dart'; |
| 8 export 'src/multi_channel.dart'; | 9 export 'src/multi_channel.dart'; |
| 9 | 10 |
| 10 /// An abstract class representing a two-way communication channel. | 11 /// An abstract class representing a two-way communication channel. |
| 11 /// | 12 /// |
| 12 /// Users should consider the [stream] emitting a "done" event to be the | 13 /// Users should consider the [stream] emitting a "done" event to be the |
| 13 /// canonical indicator that the channel has closed. If they wish to close the | 14 /// canonical indicator that the channel has closed. If they wish to close the |
| 14 /// channel, they should close the [sink]—canceling the stream subscription is | 15 /// channel, they should close the [sink]—canceling the stream subscription is |
| 15 /// not sufficient. Protocol errors may be emitted through the stream or through | 16 /// not sufficient. Protocol errors may be emitted through the stream or through |
| 16 /// [Sink.done], depending on their underlying cause. Note that the sink may | 17 /// [Sink.done], depending on their underlying cause. Note that the sink may |
| 17 /// silently drop events if the channel closes before [Sink.close] is called. | 18 /// silently drop events if the channel closes before [Sink.close] is called. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 80 } |
| 80 | 81 |
| 81 /// A mixin that implements the instance methods of [StreamChannel] in terms of | 82 /// A mixin that implements the instance methods of [StreamChannel] in terms of |
| 82 /// [stream] and [sink]. | 83 /// [stream] and [sink]. |
| 83 abstract class StreamChannelMixin<T> implements StreamChannel<T> { | 84 abstract class StreamChannelMixin<T> implements StreamChannel<T> { |
| 84 void pipe(StreamChannel<T> other) { | 85 void pipe(StreamChannel<T> other) { |
| 85 stream.pipe(other.sink); | 86 stream.pipe(other.sink); |
| 86 other.stream.pipe(sink); | 87 other.stream.pipe(sink); |
| 87 } | 88 } |
| 88 } | 89 } |
| OLD | NEW |