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

Unified Diff: pkg/scheduled_test/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/scheduled_test/lib/src/mock_clock.dart ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/utils.dart
diff --git a/pkg/scheduled_test/lib/src/utils.dart b/pkg/scheduled_test/lib/src/utils.dart
index 62461a6f02422bd7cf40f371548fbacb0aa42a0c..31abe958e1dc94c0b21b2356087c135756b7c26b 100644
--- a/pkg/scheduled_test/lib/src/utils.dart
+++ b/pkg/scheduled_test/lib/src/utils.dart
@@ -81,7 +81,7 @@ Stream errorStream(error) => new Future.error(error).asStream();
/// returned by [future] once [future] completes. If [future] completes to an
/// error, the return value will emit that error and then close.
Stream futureStream(Future<Stream> future) {
- var controller = new StreamController();
+ var controller = new StreamController(sync: true);
future.then((stream) {
stream.listen(
controller.add,
@@ -137,7 +137,7 @@ typedef void StreamCanceller();
/// the wrapped stream. Unlike [StreamSubscription], this canceller will send a
/// "done" message to the wrapped stream.
Pair<Stream, StreamCanceller> streamWithCanceller(Stream stream) {
- var controller = new StreamController();
+ var controller = new StreamController(sync: true);
var controllerStream = stream.isBroadcast ?
controller.stream.asBroadcastStream() :
controller.stream;
@@ -154,8 +154,8 @@ Pair<Stream, StreamCanceller> streamWithCanceller(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);
« no previous file with comments | « pkg/scheduled_test/lib/src/mock_clock.dart ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698