Commit 930da054 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook Github Bot

Use singleton EventBasePool in ServiceRouter

Summary:
Switching ServiceRouter code to use VirtualEventBase instead of EventBase allows us to have same thread-pool shared between multiple ServiceRouter instances.

In future this allows us to replace EventBasePoolImpl with some generic thread-pool implementation (e.g. IOThreadPoolExecutor). It also makes it trivial to have ServiceRouter run on a any existing thread-pool if necessary.

Reviewed By: smichelson

Differential Revision: D3935283

fbshipit-source-id: 3275bbace15a0df8b06d12c970ccc098a631658d
parent 895c8a62
......@@ -155,6 +155,10 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager {
return LoopKeepAlive(this);
}
bool inRunningEventBaseThread() const {
return evb_.inRunningEventBaseThread();
}
private:
using LoopCallbackList = EventBase::LoopCallback::List;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment