Skip to content

Commit

Permalink
Merge pull request dart-archive#37 from dart-lang/proper-close
Browse files Browse the repository at this point in the history
Close output stream on cancel
  • Loading branch information
grouma authored Feb 12, 2019
2 parents f3f7b70 + 14c7ae2 commit 372d04f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.20

* Close worker `outputStream` on `cancel`.

## 0.1.19

* Work around https://github.com/dart-lang/sdk/issues/35874.
Expand Down
5 changes: 4 additions & 1 deletion lib/src/driver/driver_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ class StdDriverConnection implements DriverConnection {
}

@override
Future cancel() => _messageGrouper.cancel();
Future cancel() async {
await _outputStream.close();
await _messageGrouper.cancel();
}
}

/// [DriverConnection] that works with an isolate via a [SendPort].
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: bazel_worker
version: 0.1.19
version: 0.1.20

description: Tools for creating a bazel persistent worker.
author: Dart Team <[email protected]>
Expand Down

0 comments on commit 372d04f

Please sign in to comment.