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 import 'src/stream_channel_transformer.dart'; | 7 import 'src/stream_channel_transformer.dart'; |
8 | 8 |
9 export 'src/delegating_stream_channel.dart'; | 9 export 'src/delegating_stream_channel.dart'; |
10 export 'src/isolate_channel.dart'; | 10 export 'src/isolate_channel.dart'; |
| 11 export 'src/json_document_transformer.dart'; |
11 export 'src/multi_channel.dart'; | 12 export 'src/multi_channel.dart'; |
12 export 'src/stream_channel_completer.dart'; | 13 export 'src/stream_channel_completer.dart'; |
13 export 'src/stream_channel_transformer.dart'; | 14 export 'src/stream_channel_transformer.dart'; |
14 | 15 |
15 /// An abstract class representing a two-way communication channel. | 16 /// An abstract class representing a two-way communication channel. |
16 /// | 17 /// |
17 /// Users should consider the [stream] emitting a "done" event to be the | 18 /// Users should consider the [stream] emitting a "done" event to be the |
18 /// canonical indicator that the channel has closed. If they wish to close the | 19 /// canonical indicator that the channel has closed. If they wish to close the |
19 /// channel, they should close the [sink]—canceling the stream subscription is | 20 /// channel, they should close the [sink]—canceling the stream subscription is |
20 /// not sufficient. Protocol errors may be emitted through the stream or through | 21 /// not sufficient. Protocol errors may be emitted through the stream or through |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 /// [stream] and [sink]. | 93 /// [stream] and [sink]. |
93 abstract class StreamChannelMixin<T> implements StreamChannel<T> { | 94 abstract class StreamChannelMixin<T> implements StreamChannel<T> { |
94 void pipe(StreamChannel<T> other) { | 95 void pipe(StreamChannel<T> other) { |
95 stream.pipe(other.sink); | 96 stream.pipe(other.sink); |
96 other.stream.pipe(sink); | 97 other.stream.pipe(sink); |
97 } | 98 } |
98 | 99 |
99 StreamChannel transform(StreamChannelTransformer<dynamic, T> transformer) => | 100 StreamChannel transform(StreamChannelTransformer<dynamic, T> transformer) => |
100 transformer.bind(this); | 101 transformer.bind(this); |
101 } | 102 } |
OLD | NEW |