Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: sdk/lib/async/stream.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 07378b51c910d3fe2ee3f9cc65eb2d18241ccd95..43697ecc4ff4bd220422cddf605f09d3d0a869bd 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -62,7 +62,7 @@ abstract class Stream<T> {
* data or error, and then close with a done-event.
*/
factory Stream.fromFuture(Future<T> future) {
- StreamController<T> controller = new StreamController<T>();
+ StreamController<T> controller = new StreamController<T>(sync: true);
future.then((value) {
controller.add(value);
controller.close();
@@ -114,7 +114,7 @@ abstract class Stream<T> {
});
}
- controller = new StreamController<T>(
+ controller = new StreamController<T>(sync: true,
onListen: () {
watch.start();
startPeriodicTimer();

Powered by Google App Engine
This is Rietveld 408576698