OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // States shared by single/multi stream implementations. | 7 // States shared by single/multi stream implementations. |
8 | 8 |
9 /// Initial and default state where the stream can receive and send events. | 9 /// Initial and default state where the stream can receive and send events. |
10 const int _STREAM_OPEN = 0; | 10 const int _STREAM_OPEN = 0; |
11 /// The stream has received a request to complete, but hasn't done so yet. | 11 /// The stream has received a request to complete, but hasn't done so yet. |
12 /// No further events can be aded to the stream. | 12 /// No further events can be aded to the stream. |
13 const int _STREAM_CLOSED = 1; | 13 const int _STREAM_CLOSED = 1; |
14 /// The stream has completed and will no longer receive or send events. | 14 /// The stream has completed and will no longer receive or send events. |
15 /// Also counts as closed. The stream must not be paused when it's completed. | 15 /// Also counts as closed. The stream must not be paused when it's completed. |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 if (_isComplete) { | 1019 if (_isComplete) { |
1020 throw new StateError("Subscription has been canceled."); | 1020 throw new StateError("Subscription has been canceled."); |
1021 } | 1021 } |
1022 if (_timer != null) { | 1022 if (_timer != null) { |
1023 _timer.cancel(); | 1023 _timer.cancel(); |
1024 _timer = null; | 1024 _timer = null; |
1025 } | 1025 } |
1026 _pauseCount = 0; | 1026 _pauseCount = 0; |
1027 } | 1027 } |
1028 } | 1028 } |
OLD | NEW |