Add public method to AsycnRPCQueue to retrieve all the known operation ids.
This commit is contained in:
@@ -145,3 +145,13 @@ void AsyncRPCQueue::addWorker() {
|
||||
int AsyncRPCQueue::getNumberOfWorkers() {
|
||||
return workers.size();
|
||||
}
|
||||
|
||||
|
||||
std::vector<AsyncRPCOperationId> AsyncRPCQueue::getAllOperationIds() {
|
||||
std::unique_lock< std::mutex > guard(cs_lock);
|
||||
std::vector<AsyncRPCOperationId> v;
|
||||
for(auto & entry: operationMap)
|
||||
v.push_back(entry.first);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public:
|
||||
std::shared_ptr<AsyncRPCOperation> getOperationForId(AsyncRPCOperationId);
|
||||
std::shared_ptr<AsyncRPCOperation> popOperationForId(AsyncRPCOperationId);
|
||||
void addOperation(const std::shared_ptr<AsyncRPCOperation> &ptrOperation);
|
||||
std::vector<AsyncRPCOperationId> getAllOperationIds();
|
||||
|
||||
private:
|
||||
// addWorker() will spawn a new thread on this method
|
||||
|
||||
Reference in New Issue
Block a user