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

Unified Diff: sdk/lib/_internal/pub/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 | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/test/error_group_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index b3ae8638dc7748cb915fc527fbb146005a0b8254..aceec1c740d80181296f4188d8d4d56b684ac7ba 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -183,7 +183,7 @@ Future streamFirst(Stream stream) {
/// Returns a wrapped version of [stream] along with a [StreamSubscription] that
/// can be used to control the wrapped stream.
Pair<Stream, StreamSubscription> streamWithSubscription(Stream stream) {
- var controller = new StreamController();
+ var controller = new StreamController(sync: true);
var controllerStream = stream.isBroadcast ?
controller.stream.asBroadcastStream() :
controller.stream;
@@ -198,8 +198,8 @@ Pair<Stream, StreamSubscription> streamWithSubscription(Stream stream) {
/// 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);
@@ -217,7 +217,7 @@ Pair<Stream, Stream> tee(Stream stream) {
/// both sources.
Stream mergeStreams(Stream stream1, Stream stream2) {
var doneCount = 0;
- var controller = new StreamController();
+ var controller = new StreamController(sync: true);
for (var stream in [stream1, stream2]) {
stream.listen((value) {
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/test/error_group_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698