MCPcopy Create free account
hub / github.com/apache/trafficserver / handleTimerEvent

Function handleTimerEvent

src/tscpp/api/AsyncTimer.cc:50–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48namespace
49{
50int
51handleTimerEvent(TSCont cont, TSEvent /* event ATS_UNUSED */, void * /* edata ATS_UNUSED */)
52{
53 AsyncTimerState *state = static_cast<AsyncTimerState *>(TSContDataGet(cont));
54 if (state->initial_timer_action_) {
55 LOG_DEBUG("Received initial timer event.");
56 state->initial_timer_action_ = nullptr; // mark it so that it won't be canceled later on
57 if (state->type_ == AsyncTimer::TYPE_PERIODIC) {
58 LOG_DEBUG("Scheduling periodic event now");
59 state->periodic_timer_action_ = TSContScheduleEveryOnPool(state->cont_, state->period_in_ms_, state->thread_pool_);
60 }
61 }
62 if (!state->dispatch_controller_->dispatch()) {
63 LOG_DEBUG("Receiver has died. Destroying timer");
64 delete state->timer_; // auto-destruct only in this case
65 }
66 return 0;
67}
68} // namespace
69
70AsyncTimer::AsyncTimer(Type type, int period_in_ms, int initial_period_in_ms, TSThreadPool thread_pool)

Callers

nothing calls this directly

Calls 3

TSContDataGetFunction · 0.85
dispatchMethod · 0.45

Tested by

no test coverage detected