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);
* interval timeouts using scheduleTimeout(callback) method.
*/
static int DEFAULT_TICK_INTERVAL;
- explicit HHWheelTimer(folly::EventBase* eventBase,
- std::chrono::milliseconds intervalMS =
- std::chrono::milliseconds(DEFAULT_TICK_INTERVAL),
- AsyncTimeout::InternalEnum internal =
- AsyncTimeout::InternalEnum::NORMAL,
- std::chrono::milliseconds defaultTimeoutMS =
- std::chrono::milliseconds(-1));
+ explicit HHWheelTimer(
+ folly::TimeoutManager* timeoutManager,
+ std::chrono::milliseconds intervalMS =
+ std::chrono::milliseconds(DEFAULT_TICK_INTERVAL),
+ AsyncTimeout::InternalEnum internal = AsyncTimeout::InternalEnum::NORMAL,
+ std::chrono::milliseconds defaultTimeoutMS =
+ std::chrono::milliseconds(-1));
/**
* Destroy the HHWheelTimer.