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

Side by Side Diff: lib/stream_channel.dart

Issue 1617483003: Add a DelegatingStreamChannel class. (Closed) Base URL: git@github.com:dart-lang/stream_channel.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « lib/src/delegating_stream_channel.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import 'dart:async'; 5 import 'dart:async';
6 6
7 export 'src/delegating_stream_channel.dart';
7 export 'src/multi_channel.dart'; 8 export 'src/multi_channel.dart';
8 9
9 /// An abstract class representing a two-way communication channel. 10 /// An abstract class representing a two-way communication channel.
10 /// 11 ///
11 /// Subclasses are strongly encouraged to mix in or extend [StreamChannelMixin] 12 /// Subclasses are strongly encouraged to mix in or extend [StreamChannelMixin]
12 /// to get default implementations of the various instance methods. Adding new 13 /// to get default implementations of the various instance methods. Adding new
13 /// methods to this interface will not be considered a breaking change if 14 /// methods to this interface will not be considered a breaking change if
14 /// implementations are also added to [StreamChannelMixin]. 15 /// implementations are also added to [StreamChannelMixin].
15 abstract class StreamChannel<T> { 16 abstract class StreamChannel<T> {
16 /// The stream that emits values from the other endpoint. 17 /// The stream that emits values from the other endpoint.
(...skipping 24 matching lines...) Expand all
41 } 42 }
42 43
43 /// A mixin that implements the instance methods of [StreamChannel] in terms of 44 /// A mixin that implements the instance methods of [StreamChannel] in terms of
44 /// [stream] and [sink]. 45 /// [stream] and [sink].
45 abstract class StreamChannelMixin<T> implements StreamChannel<T> { 46 abstract class StreamChannelMixin<T> implements StreamChannel<T> {
46 void pipe(StreamChannel<T> other) { 47 void pipe(StreamChannel<T> other) {
47 stream.pipe(other.sink); 48 stream.pipe(other.sink);
48 other.stream.pipe(sink); 49 other.stream.pipe(sink);
49 } 50 }
50 } 51 }
OLDNEW
« no previous file with comments | « lib/src/delegating_stream_channel.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698