Expand description
基于 Tokio 的进程内定时任务运行时。
任务通过 timer 宏注册,名称固定为任务函数名。唤醒任务时既可以传字符串,
也可以传入由 generate feature 的 [generate_name::generate] 生成的名称枚举,
两者都实现了 TimerNameLike。
Macros§
- push_
timer - 向链接期全局注册表提交一个定时任务。 Enter an element into the plugin registry corresponding to its type.
Structs§
- Timer
Option - 定时任务运行时的基础配置。
- Timer
Registration - 由
#[timer]生成并收集的任务元数据。 - Timer
Result - 定时任务执行后的调度结果。
Traits§
- Timer
Name Like - 可被定时任务运行时按名称匹配的类型。
Functions§
- start
- 启动所有已注册的定时任务。
- timer_
iter - 获取当前链接到进程的全部定时任务。
- wake
- 立即唤醒名称匹配的任一空闲定时任务实例。
Type Aliases§
- Timer
Future - 已装箱的定时任务 Future。
- Timer
Target - 可被定时器调度的无参异步任务。
- Timer
Wrapper - 为任务建立外部异步上下文的执行包装器。
Attribute Macros§
- timer
- 将异步函数注册为进程内定时任务。