| Index: lib/src/stream_channel_controller.dart
|
| diff --git a/lib/src/stream_channel_controller.dart b/lib/src/stream_channel_controller.dart
|
| index 1812a0e3a3f48d95d070e5f34c65b365b0d88b04..ad78323effb2e9402614553ca5c6da42a6f04ac3 100644
|
| --- a/lib/src/stream_channel_controller.dart
|
| +++ b/lib/src/stream_channel_controller.dart
|
| @@ -47,12 +47,18 @@ class StreamChannelController<T> {
|
| /// If [sync] is true, events added to either channel's sink are synchronously
|
| /// dispatched to the other channel's stream. This should only be done if the
|
| /// source of those events is already asynchronous.
|
| - StreamChannelController({bool sync: false}) {
|
| + ///
|
| + /// If [allowForeignErrors] is `false`, errors are not allowed to be passed to
|
| + /// the foreign channel's sink. If any are, the connection will close and the
|
| + /// error will be forwarded to the foreign channel's [Sink.done] future. This
|
| + /// guarantees that the local stream will never emit errors.
|
| + StreamChannelController({bool allowForeignErrors: true, bool sync: false}) {
|
| var localToForeignController = new StreamController<T>(sync: sync);
|
| var foreignToLocalController = new StreamController<T>(sync: sync);
|
| _local = new StreamChannel<T>.withGuarantees(
|
| foreignToLocalController.stream, localToForeignController.sink);
|
| _foreign = new StreamChannel<T>.withGuarantees(
|
| - localToForeignController.stream, foreignToLocalController.sink);
|
| + localToForeignController.stream, foreignToLocalController.sink,
|
| + allowSinkErrors: allowForeignErrors);
|
| }
|
| }
|
|
|