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

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

Issue 840953008: Alternate status page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sorted and formatted 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
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 6ef1b84fd35fb243d761479ac6626f36faebc8e1..3843ab2179cd9623601bcde783c45206bfb5d921 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -51,6 +51,19 @@ class ServerOperationQueue {
}
/**
+ * Return the next operation to perform, or `null` if the queue is empty. This
+ * method does not change the queue.
+ */
+ ServerOperation peek() {
+ for (Queue<ServerOperation> queue in _queues) {
+ if (!queue.isEmpty) {
+ return queue.first;
+ }
+ }
+ return null;
+ }
+
+ /**
* Returns the next operation to perform or `null` if empty.
*/
ServerOperation take() {

Powered by Google App Engine
This is Rietveld 408576698