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

Side by Side Diff: pkg/analysis_server/lib/src/server/driver.dart

Issue 1413403007: Wait for InstrumentationService.shutdown() before exit(0). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/instrumentation/file_instrumentation.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library driver; 5 library driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:math'; 9 import 'dart:math';
10 10
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 serverPlugin, packageResolverProvider); 421 serverPlugin, packageResolverProvider);
422 httpServer = new HttpAnalysisServer(socketServer); 422 httpServer = new HttpAnalysisServer(socketServer);
423 stdioServer = new StdioAnalysisServer(socketServer); 423 stdioServer = new StdioAnalysisServer(socketServer);
424 socketServer.userDefinedPlugins = _userDefinedPlugins; 424 socketServer.userDefinedPlugins = _userDefinedPlugins;
425 425
426 if (serve_http) { 426 if (serve_http) {
427 httpServer.serveHttp(port); 427 httpServer.serveHttp(port);
428 } 428 }
429 429
430 _captureExceptions(service, () { 430 _captureExceptions(service, () {
431 stdioServer.serveStdio().then((_) { 431 stdioServer.serveStdio().then((_) async {
432 if (serve_http) { 432 if (serve_http) {
433 httpServer.close(); 433 httpServer.close();
434 } 434 }
435 service.shutdown(); 435 await service.shutdown();
436 exit(0); 436 exit(0);
437 }); 437 });
438 }, 438 },
439 print: 439 print:
440 results[INTERNAL_PRINT_TO_CONSOLE] ? null : httpServer.recordPrint); 440 results[INTERNAL_PRINT_TO_CONSOLE] ? null : httpServer.recordPrint);
441 } 441 }
442 442
443 /** 443 /**
444 * Execute the given [callback] within a zone that will capture any unhandled 444 * Execute the given [callback] within a zone that will capture any unhandled
445 * exceptions and both report them to the client and send them to the given 445 * exceptions and both report them to the client and send them to the given
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 uuidFile.parent.createSync(recursive: true); 571 uuidFile.parent.createSync(recursive: true);
572 uuidFile.writeAsStringSync(uuid); 572 uuidFile.writeAsStringSync(uuid);
573 } catch (exception, stackTrace) { 573 } catch (exception, stackTrace) {
574 service.logPriorityException(exception, stackTrace); 574 service.logPriorityException(exception, stackTrace);
575 // Slightly alter the uuid to indicate it was not persisted 575 // Slightly alter the uuid to indicate it was not persisted
576 uuid = 'temp-$uuid'; 576 uuid = 'temp-$uuid';
577 } 577 }
578 return uuid; 578 return uuid;
579 } 579 }
580 } 580 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/instrumentation/file_instrumentation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698