From: Andrii Grynenko Date: Thu, 1 Dec 2016 01:59:58 +0000 (-0800) Subject: Use singleton EventBasePool in ServiceRouter X-Git-Tag: v2016.12.05.00~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=930da0547264c17739050ec0e9fad39887e78bab;p=folly.git 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 --- diff --git a/folly/io/async/VirtualEventBase.h b/folly/io/async/VirtualEventBase.h index c26f92cf..e18cffd4 100644 --- a/folly/io/async/VirtualEventBase.h +++ b/folly/io/async/VirtualEventBase.h @@ -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;