23 using namespace folly;
24 using std::chrono::milliseconds;
36 timestamps.emplace_back();
43 canceledTimestamps.emplace_back();
49 std::deque<TimePoint> timestamps;
50 std::deque<TimePoint> canceledTimestamps;
51 std::function<void()> fn;
56 std::chrono::steady_clock::time_point
getCurTime()
override {
177 std::function<void()> fnDtorGuard;
178 t5_3.
fn.swap(fnDtorGuard);
237 t5_3.cancelTimeout();
238 t5_1.cancelTimeout();
239 t10_1.cancelTimeout();
240 t10_2.cancelTimeout();
329 t->scheduleTimeout(&t1, milliseconds(128));
330 t->scheduleTimeout(&t2, milliseconds(128));
331 t->scheduleTimeout(&t3, milliseconds(128));
333 t3.
fn = [&]() {
t.reset(); };
351 milliseconds defaultTimeout(milliseconds(5));
396 [&] {
throw std::runtime_error(
"expected"); }, milliseconds(1));
418 t->scheduleTimeout(&t1, milliseconds(5));
419 t->scheduleTimeout(&t2, milliseconds(5));
421 DelayedDestruction::IntrusivePtr<HHWheelTimer>
s(t);
423 s->scheduleTimeout(&t3, milliseconds(10));
451 ASSERT_EQ(t1.getTimeRemaining(), milliseconds(0));
457 ASSERT_LE(t1.getTimeRemaining(), milliseconds(10));
464 ASSERT_EQ(t1.getTimeRemaining(), milliseconds(0));
#define ASSERT_EQ(val1, val2)
std::deque< TimePoint > canceledTimestamps
#define EXPECT_EQ(val1, val2)
UndelayedDestruction< HHWheelTimer > StackWheelTimer
std::chrono::steady_clock::time_point now()
#define ASSERT_LE(val1, val2)
void setDefaultTimeout(std::chrono::milliseconds timeout)
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
void scheduleTimeout(Callback *callback, std::chrono::milliseconds timeout)
std::deque< TimePoint > timestamps
TestTimeout(HHWheelTimer *t, milliseconds timeout)
static UniquePtr newTimer(Args &&...args)
void callbackCanceled() noexceptoverride
auto end(TestAdlIterable &instance)
void timeoutExpired() noexceptoverride
void scheduleTimeoutFn(F fn, std::chrono::milliseconds timeout)
std::unique_ptr< HHWheelTimer, Destructor > UniquePtr
TEST_F(AsyncSSLSocketWriteTest, write_coalescing1)
std::size_t count() const
std::chrono::milliseconds getDefaultTimeout() const
std::chrono::steady_clock::time_point getCurTime() override
std::function< void()> fn
#define T_CHECK_TIMEOUT(start, end, expectedMS,...)