Use separate IO context for socket IO (#168)

* Keep track of number of requests currently being processed
* Reject new requests when number of in flight requests exceeds a
  configurable limit
* Track time spent between request arrival and start of request
  processing

Signed-off-by: CJ Cobb <ccobb@ripple.com>

Co-authored-by: natenichols <natenichols@cox.net>
This commit is contained in:
CJ Cobb
2022-06-15 17:17:15 -04:00
committed by GitHub
parent b45b34edb1
commit d0ea9d20ab
12 changed files with 202 additions and 35 deletions

11
src/rpc/WorkQueue.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include <rpc/WorkQueue.h>
WorkQueue::WorkQueue(std::uint32_t numWorkers, uint32_t maxSize)
{
if (maxSize != 0)
maxSize_ = maxSize;
while (--numWorkers)
{
threads_.emplace_back([this] { ioc_.run(); });
}
}