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

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: 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 /** 75 /**
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 /// A set of the [ServerService] to send notifications for.
Brian Wilkerson 2014/05/24 15:19:49 I think we should consistently use the same (block
scheglov 2014/05/24 15:34:42 Done.
86 Set<ServerService> serverServices = new Set<ServerService>();
87
85 /** 88 /**
86 * Initialize a newly created server to receive requests from and send 89 * Initialize a newly created server to receive requests from and send
87 * responses to the given [channel]. 90 * responses to the given [channel].
88 */ 91 */
89 AnalysisServer(this.channel) { 92 AnalysisServer(this.channel) {
90 AnalysisEngine.instance.logger = new AnalysisLogger(); 93 AnalysisEngine.instance.logger = new AnalysisLogger();
91 running = true; 94 running = true;
92 Notification notification = new Notification(CONNECTED_NOTIFICATION); 95 Notification notification = new Notification(CONNECTED_NOTIFICATION);
93 channel.sendNotification(notification); 96 channel.sendNotification(notification);
94 channel.listen(handleRequest, onDone: done, onError: error); 97 channel.listen(handleRequest, onDone: done, onError: error);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void sendNotification(Notification notification) { 237 void sendNotification(Notification notification) {
235 channel.sendNotification(notification); 238 channel.sendNotification(notification);
236 } 239 }
237 240
238 void _scheduleTask() { 241 void _scheduleTask() {
239 new Future(performTask).catchError((ex, st) { 242 new Future(performTask).catchError((ex, st) {
240 AnalysisEngine.instance.logger.logError("${ex}\n${st}"); 243 AnalysisEngine.instance.logger.logError("${ex}\n${st}");
241 }); 244 });
242 } 245 }
243 } 246 }
247
248
249 /// An enumeration of the services provided by the server domain.
250 class ServerService extends Enum2<ServerService> {
251 static const ServerService STATUS = const ServerService('STATUS', 0);
252
253 static const List<ServerService> VALUES = const [STATUS];
254
255 const ServerService(String name, int ordinal) : super(name, ordinal);
256 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/domain_server.dart » ('j') | pkg/analysis_server/lib/src/domain_server.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698