Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

delay-timer

> 编程语言
Open source

Time-manager of delayed tasks. Like crontab, but synchronous asynchronous tasks are possible scheduling, and dynamic add/cancel/remove is supported.

329 stars0 likes0 views
WebsiteGitHub

About

Time-manager of delayed tasks. Like crontab, but synchronous asynchronous tasks are possible scheduling, and dynamic add/cancel/remove is supported.

delay-timer

Time-manager of delayed tasks. Like crontab, but synchronous asynchronous tasks are possible, and dynamic add/cancel/remove is supported.

delay-timer is a task manager based on a time wheel algorithm, which makes it easy to manage timed tasks, or to periodically execute arbitrary tasks such as closures.

The underlying runtime is based on the optional smol and tokio, and you can build your application with either one.

The minimum-supported version of rustc is 1.56.

Except for the simple execution in a few seconds, you can also specify a specific date, such as Sunday at 4am to execute a backup task.

Supports configuration of the maximum number of parallelism of tasks.
Dynamically cancel a running task instance by means of a handle.

If you're looking for a distributed task scheduling platform, check out the delicate

Examples

…

Use in asynchronous contexts.

…

Capture the specified environment information and build the closure & task:

rust
#[macro_use]
use delay_timer::prelude::*;

use std::sync::atomic::{
    AtomicUsize,
    Ordering::{Acquire, Release},
};
use std::sync::Arc;

let delay_timer = DelayTimer::new();
let share_num = Arc::new(AtomicUsize::new(0));
let share_num_bunshin = share_num.clone();

let body = move || {
    share_num_bunshin.fetch_add(1, Release);
};

let task = TaskBuilder::default()
    .set_frequency_count_down_by_cron_str(expression, 3)
    .set_task_id(1)
    .spawn_routine(body)?;

delay_timer.add_task(task)?;

Building customized-dynamic future tasks:

…

There's a lot more in the [examples] directory.

License

Licensed under either of

  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

To Do List

  • Support tokio Ecology.
  • Disable unwrap related methods that will panic.
  • Thread and running task quit when delayTimer drop.
  • neaten todo in code, replenish tests and benchmark.
  • batch-opration.
  • report-for-server.
  • Future upgrade of delay_timer to multi-wheel mode, different excutor handling different wheels e.g. subtract laps for one wheel, run task for one wheel.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustcroncrontabdelay-timerdelayed-tasks

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言