OLD | NEW |
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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'future_group.dart'; | 7 import 'future_group.dart'; |
8 import 'result.dart'; | 8 import 'result/result.dart'; |
9 | 9 |
10 /// A class that splits a single source stream into an arbitrary number of | 10 /// A class that splits a single source stream into an arbitrary number of |
11 /// (single-subscription) streams (called "branch") that emit the same events. | 11 /// (single-subscription) streams (called "branch") that emit the same events. |
12 /// | 12 /// |
13 /// Each branch will emit all the same values and errors as the source stream, | 13 /// Each branch will emit all the same values and errors as the source stream, |
14 /// regardless of which values have been emitted on other branches. This means | 14 /// regardless of which values have been emitted on other branches. This means |
15 /// that the splitter stores every event that has been emitted so far, which may | 15 /// that the splitter stores every event that has been emitted so far, which may |
16 /// consume a lot of memory. The user can call [close] to indicate that no more | 16 /// consume a lot of memory. The user can call [close] to indicate that no more |
17 /// branches will be created, and this memory will be released. | 17 /// branches will be created, and this memory will be released. |
18 /// | 18 /// |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 /// Marks [_controllers] as done. | 200 /// Marks [_controllers] as done. |
201 void _onDone() { | 201 void _onDone() { |
202 _isDone = true; | 202 _isDone = true; |
203 for (var controller in _controllers) { | 203 for (var controller in _controllers) { |
204 _closeGroup.add(controller.close()); | 204 _closeGroup.add(controller.close()); |
205 } | 205 } |
206 } | 206 } |
207 } | 207 } |
OLD | NEW |