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

Unified Diff: pkg/http/lib/src/utils.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments 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
« no previous file with comments | « pkg/http/lib/src/streamed_request.dart ('k') | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index 4a3b84c0614ea6e71cc0d32c10dcc67570c46bef..7be3938116c20a2795895fbc2c214cc4efe2405b 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -173,7 +173,7 @@ Stream get emptyStream => streamFromIterable([]);
/// Creates a single-subscription stream that emits the items in [iter] and then
/// ends.
Stream streamFromIterable(Iterable iter) {
- var controller = new StreamController();
+ var controller = new StreamController(sync: true);
iter.forEach(controller.add);
controller.close();
return controller.stream;
@@ -184,8 +184,8 @@ Stream streamFromIterable(Iterable iter) {
/// errors from [stream]. This is useful if [stream] is single-subscription but
/// multiple subscribers are necessary.
Pair<Stream, Stream> tee(Stream stream) {
- var controller1 = new StreamController();
- var controller2 = new StreamController();
+ var controller1 = new StreamController(sync: true);
+ var controller2 = new StreamController(sync: true);
stream.listen((value) {
controller1.add(value);
controller2.add(value);
« no previous file with comments | « pkg/http/lib/src/streamed_request.dart ('k') | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698