Skip to content

Commit d0ea3c1

Browse files
authored
Merge pull request dart-archive/bazel_worker#37 from dart-lang/proper-close
Close output stream on cancel
2 parents 86c98c5 + d10b84b commit d0ea3c1

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

pkgs/bazel_worker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.20
2+
3+
* Close worker `outputStream` on `cancel`.
4+
15
## 0.1.19
26

37
* Work around https://github.com/dart-lang/sdk/issues/35874.

pkgs/bazel_worker/lib/src/driver/driver_connection.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ class StdDriverConnection implements DriverConnection {
7777
}
7878

7979
@override
80-
Future cancel() => _messageGrouper.cancel();
80+
Future cancel() async {
81+
await _outputStream.close();
82+
await _messageGrouper.cancel();
83+
}
8184
}
8285

8386
/// [DriverConnection] that works with an isolate via a [SendPort].

pkgs/bazel_worker/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: bazel_worker
2-
version: 0.1.19
2+
version: 0.1.20
33

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

0 commit comments

Comments
 (0)