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

Unified Diff: pkg/analyzer_cli/lib/src/build_mode.dart

Issue 2998603002: Make AnalyzerWorkerLoop AsyncWorkerLoop. (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | pkg/analyzer_cli/test/build_mode_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/build_mode.dart
diff --git a/pkg/analyzer_cli/lib/src/build_mode.dart b/pkg/analyzer_cli/lib/src/build_mode.dart
index f5c3b1f95b3e8d0a803fd98f02e51b6681f4394f..353563159a40e0c887cf877ff9d9d4fa3e82475b 100644
--- a/pkg/analyzer_cli/lib/src/build_mode.dart
+++ b/pkg/analyzer_cli/lib/src/build_mode.dart
@@ -4,6 +4,7 @@
library analyzer_cli.src.build_mode;
+import 'dart:async';
import 'dart:io' as io;
import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit;
@@ -32,21 +33,21 @@ import 'package:bazel_worker/bazel_worker.dart';
/**
* Persistent Bazel worker.
*/
-class AnalyzerWorkerLoop extends SyncWorkerLoop {
+class AnalyzerWorkerLoop extends AsyncWorkerLoop {
final StringBuffer errorBuffer = new StringBuffer();
final StringBuffer outBuffer = new StringBuffer();
final ResourceProvider resourceProvider;
final String dartSdkPath;
- AnalyzerWorkerLoop(this.resourceProvider, SyncWorkerConnection connection,
+ AnalyzerWorkerLoop(this.resourceProvider, AsyncWorkerConnection connection,
{this.dartSdkPath})
: super(connection: connection);
factory AnalyzerWorkerLoop.std(ResourceProvider resourceProvider,
{io.Stdin stdinStream, io.Stdout stdoutStream, String dartSdkPath}) {
- SyncWorkerConnection connection = new StdSyncWorkerConnection(
- stdinStream: stdinStream, stdoutStream: stdoutStream);
+ AsyncWorkerConnection connection = new StdAsyncWorkerConnection(
+ inputStream: stdinStream, outputStream: stdoutStream);
return new AnalyzerWorkerLoop(resourceProvider, connection,
dartSdkPath: dartSdkPath);
}
@@ -63,7 +64,7 @@ class AnalyzerWorkerLoop extends SyncWorkerLoop {
* Perform a single loop step.
*/
@override
- WorkResponse performRequest(WorkRequest request) {
+ Future<WorkResponse> performRequest(WorkRequest request) async {
errorBuffer.clear();
outBuffer.clear();
try {
@@ -98,13 +99,13 @@ class AnalyzerWorkerLoop extends SyncWorkerLoop {
* Run the worker loop.
*/
@override
- void run() {
+ Future<Null> run() async {
errorSink = errorBuffer;
outSink = outBuffer;
exitHandler = (int exitCode) {
return throw new StateError('Exit called: $exitCode');
};
- super.run();
+ await super.run();
}
String _getErrorOutputBuffersText() {
« no previous file with comments | « no previous file | pkg/analyzer_cli/test/build_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698