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

Method run

src/tscpp/api/AsyncTimer.cc:77–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void
78AsyncTimer::run()
79{
80 state_->dispatch_controller_ = getDispatchController(); // keep a copy in state so that cont handler can use it
81 int one_off_timeout_in_ms = 0;
82 int regular_timeout_in_ms = 0;
83 if (state_->type_ == AsyncTimer::TYPE_ONE_OFF) {
84 one_off_timeout_in_ms = state_->period_in_ms_;
85 } else {
86 one_off_timeout_in_ms = state_->initial_period_in_ms_;
87 regular_timeout_in_ms = state_->period_in_ms_;
88 }
89 if (one_off_timeout_in_ms) {
90 LOG_DEBUG("Scheduling initial/one-off event");
91 state_->initial_timer_action_ = TSContScheduleOnPool(state_->cont_, one_off_timeout_in_ms, state_->thread_pool_);
92 } else if (regular_timeout_in_ms) {
93 LOG_DEBUG("Scheduling regular timer events");
94 state_->periodic_timer_action_ = TSContScheduleEveryOnPool(state_->cont_, regular_timeout_in_ms, state_->thread_pool_);
95 }
96}
97
98void
99AsyncTimer::cancel()

Callers

nothing calls this directly

Calls 2

TSContScheduleOnPoolFunction · 0.85

Tested by

no test coverage detected