ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::asio_timer Class Reference

网络代码使用的进程级时间轮单例类。 More...

#include <asio_timer.h>

Static Public Member Functions

static tools::time_wheelwheel ()
 获取单例时间轮实例引用。

Detailed Description

网络代码使用的进程级时间轮单例类。

提供全局唯一的时间轮实例,用于轻量级周期任务调度。 主要用于:

  • KCP协议的ikcp_update定时调用
  • 网络连接心跳检测
  • 连接超时和重连定时器
Note
该类不可实例化,所有方法都是静态的。
时间轮精度为毫秒级,适合网络定时任务。
设计为纯静态工具类,禁止实例化。选择使用 class 而非 namespace 是为了与项目其它单例类风格保持一致。

Member Function Documentation

◆ wheel()

tools::time_wheel & ngl::asio_timer::wheel ( )
static

获取单例时间轮实例引用。

Returns
tools::time_wheel& 时间轮引用

The documentation for this class was generated from the following files: