add tryCreateNetwork()
[folly.git] / folly / PriorityMPMCQueue.h
index fb4e4645228d8ff8985cca87380b1645f79e9922..08c498358d498b1bfe2935457142b81c9359677b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,6 +66,10 @@ class PriorityMPMCQueue {
     return false;
   }
 
+  bool readWithPriority(T& item, size_t priority) {
+    return queues_[priority].readIfNotEmpty(item);
+  }
+
   size_t size() const {
     size_t total_size = 0;
     for (auto& q : queues_) {