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 // TODO(nweiz): Get rid of this when https://codereview.chromium.org/1241723003/ | 5 // TODO(nweiz): Get rid of this when https://codereview.chromium.org/1241723003/ |
6 // lands. | 6 // lands. |
7 library test.util.forkable_stream_queue; | |
8 | |
9 import 'dart:async'; | 7 import 'dart:async'; |
10 import 'dart:collection'; | 8 import 'dart:collection'; |
11 | 9 |
12 import "package:async/async.dart" hide ForkableStream, StreamQueue; | 10 import "package:async/async.dart" hide ForkableStream, StreamQueue; |
13 | 11 |
14 import "forkable_stream.dart"; | 12 import "forkable_stream.dart"; |
15 | 13 |
16 /// An asynchronous pull-based interface for accessing stream events. | 14 /// An asynchronous pull-based interface for accessing stream events. |
17 /// | 15 /// |
18 /// Wraps a stream and makes individual events available on request. | 16 /// Wraps a stream and makes individual events available on request. |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 event.addTo(controller); | 688 event.addTo(controller); |
691 } | 689 } |
692 | 690 |
693 var fork = _streamQueue._sourceStream.fork(); | 691 var fork = _streamQueue._sourceStream.fork(); |
694 controller.addStream(fork, cancelOnError: false) | 692 controller.addStream(fork, cancelOnError: false) |
695 .whenComplete(controller.close); | 693 .whenComplete(controller.close); |
696 _completer.setSourceStream(controller.stream); | 694 _completer.setSourceStream(controller.stream); |
697 } | 695 } |
698 } | 696 } |
699 } | 697 } |
OLD | NEW |