Line data Source code
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
3 : // BSD-style license that can be found in the LICENSE file.
4 :
5 : import 'dart:async';
6 :
7 : import '../stream_channel.dart';
8 :
9 : /// A simple delegating wrapper around [StreamChannel].
10 : ///
11 : /// Subclasses can override individual methods, or use this to expose only
12 : /// [StreamChannel] methods.
13 : class DelegatingStreamChannel<T> extends StreamChannelMixin<T> {
14 : /// The inner channel to which methods are forwarded.
15 : final StreamChannel<T> _inner;
16 :
17 0 : Stream<T> get stream => _inner.stream;
18 0 : StreamSink<T> get sink => _inner.sink;
19 :
20 0 : DelegatingStreamChannel(this._inner);
21 : }
|