FIX 4.0 Demo 1.0
Loading...
Searching...
No Matches
timing_wheel.hpp File Reference

时间轮定时器实现 More...

#include <vector>
#include <list>
#include <functional>
#include <memory>
#include <mutex>
#include <unordered_map>
#include <atomic>
#include <climits>
Include dependency graph for timing_wheel.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fix40::TimingWheel
 支持周期性任务的时间轮定时器 More...
 

Namespaces

namespace  fix40
 

Typedefs

using fix40::TimerTask = std::function< void()>
 定时任务回调函数类型
 
using fix40::TimerTaskId = uint64_t
 定时任务唯一标识符类型
 

Variables

constexpr int fix40::MAX_SAFE_DELAY_MS = INT_MAX / 1000
 最大安全延迟时间(毫秒),防止整数溢出
 
constexpr TimerTaskId fix40::INVALID_TIMER_ID = 0
 无效的定时任务 ID
 

Detailed Description

时间轮定时器实现

提供高效的定时任务管理,支持一次性和周期性任务, 适用于心跳检测、超时管理等场景。