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

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

Issue 297153002: Implementation of 'Server Domain' in dart analysis server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
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 analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_logger.dart'; 9 import 'package:analysis_server/src/analysis_logger.dart';
10 import 'package:analysis_server/src/channel.dart'; 10 import 'package:analysis_server/src/channel.dart';
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 * A list of the analysis contexts for which analysis work needs to be 76 * A list of the analysis contexts for which analysis work needs to be
77 * performed. 77 * performed.
78 * 78 *
79 * Invariant: when this list is non-empty, there is exactly one pending call 79 * Invariant: when this list is non-empty, there is exactly one pending call
80 * to [performTask] on the event queue. When this list is empty, there are 80 * to [performTask] on the event queue. When this list is empty, there are
81 * no calls to [performTask] on the event queue. 81 * no calls to [performTask] on the event queue.
82 */ 82 */
83 final List<AnalysisContext> contextWorkQueue = new List<AnalysisContext>(); 83 final List<AnalysisContext> contextWorkQueue = new List<AnalysisContext>();
84 84
85 /** 85 /**
86 * A set of the [ServerService]s to send notifications for.
87 */
88 Set<ServerService> serverServices = new Set<ServerService>();
89
90 /**
86 * Initialize a newly created server to receive requests from and send 91 * Initialize a newly created server to receive requests from and send
87 * responses to the given [channel]. 92 * responses to the given [channel].
88 */ 93 */
89 AnalysisServer(this.channel) { 94 AnalysisServer(this.channel) {
90 AnalysisEngine.instance.logger = new AnalysisLogger(); 95 AnalysisEngine.instance.logger = new AnalysisLogger();
91 running = true; 96 running = true;
92 Notification notification = new Notification(CONNECTED_NOTIFICATION); 97 Notification notification = new Notification(CONNECTED_NOTIFICATION);
93 channel.sendNotification(notification); 98 channel.sendNotification(notification);
94 channel.listen(handleRequest, onDone: done, onError: error); 99 channel.listen(handleRequest, onDone: done, onError: error);
95 } 100 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void sendNotification(Notification notification) { 239 void sendNotification(Notification notification) {
235 channel.sendNotification(notification); 240 channel.sendNotification(notification);
236 } 241 }
237 242
238 void _scheduleTask() { 243 void _scheduleTask() {
239 new Future(performTask).catchError((ex, st) { 244 new Future(performTask).catchError((ex, st) {
240 AnalysisEngine.instance.logger.logError("${ex}\n${st}"); 245 AnalysisEngine.instance.logger.logError("${ex}\n${st}");
241 }); 246 });
242 } 247 }
243 } 248 }
249
250
251 /// An enumeration of the services provided by the server domain.
Brian Wilkerson 2014/05/24 15:49:11 I should have mentioned that there are lots of pla
scheglov 2014/05/24 16:07:26 Fixed here and in protocol.dart file. As far as I
252 class ServerService extends Enum2<ServerService> {
253 static const ServerService STATUS = const ServerService('STATUS', 0);
254
255 static const List<ServerService> VALUES = const [STATUS];
256
257 const ServerService(String name, int ordinal) : super(name, ordinal);
258 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/domain_server.dart » ('j') | pkg/analysis_server/lib/src/protocol.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698