Commit c3d672e3 authored by Alan Frindell's avatar Alan Frindell Committed by facebook-github-bot-1

Make HHWheelTimer take a TimeoutManager rather than EventBase

Summary: TimeoutManager is a Mockable parent class

Reviewed By: maxgeorg

Differential Revision: D2892671

fb-gh-sync-id: d20635b18a7c748009ce4880c80a13ac23b9222a
parent c87fa8d6
......@@ -78,20 +78,18 @@ void HHWheelTimer::Callback::cancelTimeoutImpl() {
expiration_ = milliseconds(0);
}
HHWheelTimer::HHWheelTimer(folly::EventBase* eventBase,
HHWheelTimer::HHWheelTimer(folly::TimeoutManager* timeoutMananger,
std::chrono::milliseconds intervalMS,
AsyncTimeout::InternalEnum internal,
std::chrono::milliseconds defaultTimeoutMS)
: AsyncTimeout(eventBase, internal)
, interval_(intervalMS)
, defaultTimeout_(defaultTimeoutMS)
, nextTick_(1)
, count_(0)
, catchupEveryN_(DEFAULT_CATCHUP_EVERY_N)
, expirationsSinceCatchup_(0)
, processingCallbacksGuard_(false)
{
}
: AsyncTimeout(timeoutMananger, internal),
interval_(intervalMS),
defaultTimeout_(defaultTimeoutMS),
nextTick_(1),
count_(0),
catchupEveryN_(DEFAULT_CATCHUP_EVERY_N),
expirationsSinceCatchup_(0),
processingCallbacksGuard_(false) {}
HHWheelTimer::~HHWheelTimer() {
CHECK(count_ == 0);
......
......@@ -166,11 +166,11 @@ class HHWheelTimer : private folly::AsyncTimeout,
* interval timeouts using scheduleTimeout(callback) method.
*/
static int DEFAULT_TICK_INTERVAL;
explicit HHWheelTimer(folly::EventBase* eventBase,
explicit HHWheelTimer(
folly::TimeoutManager* timeoutManager,
std::chrono::milliseconds intervalMS =
std::chrono::milliseconds(DEFAULT_TICK_INTERVAL),
AsyncTimeout::InternalEnum internal =
AsyncTimeout::InternalEnum::NORMAL,
AsyncTimeout::InternalEnum internal = AsyncTimeout::InternalEnum::NORMAL,
std::chrono::milliseconds defaultTimeoutMS =
std::chrono::milliseconds(-1));
......
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