Index: lib/src/isolate_channel.dart |
diff --git a/lib/src/isolate_channel.dart b/lib/src/isolate_channel.dart |
index 3466d19dd10b98f9b8beea4ec9d9f6280d21a5fa..6f86657359628e1688ee86be93cfa7aca3a93ca9 100644 |
--- a/lib/src/isolate_channel.dart |
+++ b/lib/src/isolate_channel.dart |
@@ -10,6 +10,8 @@ import 'package:stack_trace/stack_trace.dart'; |
import '../stream_channel.dart'; |
+import 'dart:io'; |
+ |
/// A [StreamChannel] that communicates over a [ReceivePort]/[SendPort] pair, |
/// presumably with another isolate. |
/// |
@@ -53,7 +55,8 @@ class IsolateChannel<T> extends StreamChannelMixin<T> { |
var subscription; |
subscription = receivePort.listen((message) { |
if (message is SendPort) { |
- var controller = new StreamChannelController(allowForeignErrors: false); |
+ var controller = new StreamChannelController( |
+ allowForeignErrors: false, sync: true); |
new SubscriptionStream<T>(subscription).pipe(controller.local.sink); |
controller.local.stream.listen(message.send, |
onDone: receivePort.close); |
@@ -91,7 +94,8 @@ class IsolateChannel<T> extends StreamChannelMixin<T> { |
/// Creates a stream channel that receives messages from [receivePort] and |
/// sends them over [sendPort]. |
factory IsolateChannel(ReceivePort receivePort, SendPort sendPort) { |
- var controller = new StreamChannelController(allowForeignErrors: false); |
+ var controller = new StreamChannelController( |
+ allowForeignErrors: false, sync: true); |
receivePort.pipe(controller.local.sink); |
controller.local.stream.listen(sendPort.send, onDone: receivePort.close); |
return new IsolateChannel._( |