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

Unified Diff: pkg/analysis_server/lib/src/operation/operation_queue.dart

Issue 847663005: Send notifications using separate server operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | pkg/analysis_server/test/mocks.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/operation/operation_queue.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_queue.dart b/pkg/analysis_server/lib/src/operation/operation_queue.dart
index b26c677f60e2d6d7479d42c899f2cdfc2fd0f491..6ef1b84fd35fb243d761479ac6626f36faebc8e1 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -8,21 +8,15 @@ import 'dart:collection';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/operation/operation.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
/**
* A queue of operations in an [AnalysisServer].
*/
class ServerOperationQueue {
- final List<ServerOperationPriority> _analysisPriorities = [
- ServerOperationPriority.ANALYSIS_CONTINUE,
- ServerOperationPriority.ANALYSIS];
-
- final AnalysisServer _server;
final List<Queue<ServerOperation>> _queues = <Queue<ServerOperation>>[];
- ServerOperationQueue(this._server) {
+ ServerOperationQueue() {
for (int i = 0; i < ServerOperationPriority.COUNT; i++) {
var queue = new DoubleLinkedQueue<ServerOperation>();
_queues.add(queue);
@@ -60,23 +54,11 @@ class ServerOperationQueue {
* Returns the next operation to perform or `null` if empty.
*/
ServerOperation take() {
- // try to find a priority analysis operarion
- for (ServerOperationPriority priority in _analysisPriorities) {
- Queue<ServerOperation> queue = _queues[priority.ordinal];
- for (PerformAnalysisOperation operation in queue) {
- if (_server.isPriorityContext(operation.context)) {
- queue.remove(operation);
- return operation;
- }
- }
- }
- // non-priority operations
for (Queue<ServerOperation> queue in _queues) {
if (!queue.isEmpty) {
return queue.removeFirst();
}
}
- // empty
return null;
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | pkg/analysis_server/test/mocks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698