| 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 library async.stream_events; | |
| 6 | |
| 7 import 'dart:async'; | 5 import 'dart:async'; |
| 8 import 'dart:collection'; | 6 import 'dart:collection'; |
| 9 | 7 |
| 8 import "result.dart"; |
| 10 import "subscription_stream.dart"; | 9 import "subscription_stream.dart"; |
| 11 import "stream_completer.dart"; | 10 import "stream_completer.dart"; |
| 12 import "../result.dart"; | |
| 13 | 11 |
| 14 /// An asynchronous pull-based interface for accessing stream events. | 12 /// An asynchronous pull-based interface for accessing stream events. |
| 15 /// | 13 /// |
| 16 /// Wraps a stream and makes individual events available on request. | 14 /// Wraps a stream and makes individual events available on request. |
| 17 /// | 15 /// |
| 18 /// You can request (and reserve) one or more events from the stream, | 16 /// You can request (and reserve) one or more events from the stream, |
| 19 /// and after all previous requests have been fulfilled, stream events | 17 /// and after all previous requests have been fulfilled, stream events |
| 20 /// go towards fulfilling your request. | 18 /// go towards fulfilling your request. |
| 21 /// | 19 /// |
| 22 /// For example, if you ask for [next] two times, the returned futures | 20 /// For example, if you ask for [next] two times, the returned futures |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 _completer.complete(true); | 637 _completer.complete(true); |
| 640 return true; | 638 return true; |
| 641 } | 639 } |
| 642 if (isDone) { | 640 if (isDone) { |
| 643 _completer.complete(false); | 641 _completer.complete(false); |
| 644 return true; | 642 return true; |
| 645 } | 643 } |
| 646 return false; | 644 return false; |
| 647 } | 645 } |
| 648 } | 646 } |
| OLD | NEW |