OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of "dart:async"; | 5 part of dart.async; |
6 | 6 |
7 // ------------------------------------------------------------------- | 7 // ------------------------------------------------------------------- |
8 // Core Stream types | 8 // Core Stream types |
9 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
10 | 10 |
11 typedef void _TimerCallback(); | 11 typedef void _TimerCallback(); |
12 | 12 |
13 /** | 13 /** |
14 * A source of asynchronous data events. | 14 * A source of asynchronous data events. |
15 * | 15 * |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 /// Must only be used instead of listening to the [values] stream. | 1932 /// Must only be used instead of listening to the [values] stream. |
1933 /// If the stream has been listened to, this call fails. | 1933 /// If the stream has been listened to, this call fails. |
1934 /// After calling this method, listening on the [values] stream fails. | 1934 /// After calling this method, listening on the [values] stream fails. |
1935 Future cancel() { | 1935 Future cancel() { |
1936 // If values has been listened to, | 1936 // If values has been listened to, |
1937 // this throws a StateError saying that stream has already been listened to, | 1937 // this throws a StateError saying that stream has already been listened to, |
1938 // which is a correct error message for this call too. | 1938 // which is a correct error message for this call too. |
1939 return values.listen(null).cancel(); | 1939 return values.listen(null).cancel(); |
1940 } | 1940 } |
1941 } | 1941 } |
OLD | NEW |