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

Side by Side Diff: lib/src/delegate/stream_subscription.dart

Issue 1219493008: Add a bunch of delegates for dart:async types. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library async.delegating_stream_subscription; 5 library async.delegate.stream_subscription;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 /// Simple delegating wrapper around a [StreamSubscription]. 9 /// Simple delegating wrapper around a [StreamSubscription].
10 /// 10 ///
11 /// Subclasses can override individual methods. 11 /// Subclasses can override individual methods.
12 class DelegatingStreamSubscription<T> implements StreamSubscription<T> { 12 class DelegatingStreamSubscription<T> implements StreamSubscription<T> {
13 final StreamSubscription _source; 13 final StreamSubscription _source;
14 14
15 /// Create delegating subscription forwarding calls to [sourceSubscription]. 15 /// Create delegating subscription forwarding calls to [sourceSubscription].
(...skipping 19 matching lines...) Expand all
35 void resume() { 35 void resume() {
36 _source.resume(); 36 _source.resume();
37 } 37 }
38 38
39 Future cancel() => _source.cancel(); 39 Future cancel() => _source.cancel();
40 40
41 Future asFuture([futureValue]) => _source.asFuture(futureValue); 41 Future asFuture([futureValue]) => _source.asFuture(futureValue);
42 42
43 bool get isPaused => _source.isPaused; 43 bool get isPaused => _source.isPaused;
44 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698