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

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

Issue 869153003: Prioritize analysis operations for contexts with priority files. (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 3843ab2179cd9623601bcde783c45206bfb5d921..67ca99310f580a6cefc19896986c27567f13c7f0 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -64,6 +64,20 @@ class ServerOperationQueue {
}
/**
+ * Reschedules queued operations according their current priorities.
+ */
+ void reschedule() {
+ // prepare all operations
+ List<ServerOperation> operations = <ServerOperation>[];
+ for (Queue<ServerOperation> queue in _queues) {
+ operations.addAll(queue);
+ queue.clear();
+ }
+ // add all operations
+ operations.forEach(add);
+ }
+
+ /**
* Returns the next operation to perform or `null` if empty.
*/
ServerOperation take() {
« 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