Skip to main content

Crate framework_timer

Crate framework_timer 

Source
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§

TimerOption
定时任务运行时的基础配置。
TimerRegistration
由 #[timer] 生成并收集的任务元数据。
TimerResult
定时任务执行后的调度结果。

Traits§

TimerNameLike
可被定时任务运行时按名称匹配的类型。

Functions§

start
启动所有已注册的定时任务。
timer_iter
获取当前链接到进程的全部定时任务。
wake
立即唤醒名称匹配的任一空闲定时任务实例。

Type Aliases§

TimerFuture
已装箱的定时任务 Future。
TimerTarget
可被定时器调度的无参异步任务。
TimerWrapper
为任务建立外部异步上下文的执行包装器。

Attribute Macros§

timer
将异步函数注册为进程内定时任务。