25 #include <seastar/util/std-compat.hh>
28 #include <seastar/core/future.hh>
29 #include <seastar/core/timer-set.hh>
51 using steady_clock_type = std::chrono::steady_clock;
77 template <
typename Clock = steady_clock_type>
80 typedef typename Clock::time_point time_point;
81 typedef typename Clock::duration duration;
85 boost::intrusive::list_member_hook<> _link;
89 std::optional<duration> _period;
92 bool _expired =
false;
93 void readd_periodic() noexcept;
94 void arm_state(time_point until, std::optional<duration> period) noexcept {
110 timer(
timer&& t) noexcept : _sg(t._sg), _callback(std::move(t._callback)), _expiry(std::move(t._expiry)), _period(std::move(t._period)),
111 _armed(t._armed), _queued(t._queued), _expired(t._expired) {
112 _link.swap_nodes(t._link);
135 _callback = std::move(callback);
154 void arm(time_point until, std::optional<duration> period = {}) noexcept;
162 void rearm(time_point until, std::optional<duration> period = {}) noexcept {
176 void arm(duration delta) noexcept {
200 bool armed() const noexcept {
return _armed; }
219 extern template class timer<steady_clock_type>;