tardy
309
Stars
23
Forks
6
Watchers
19
Open Issues
MPL-2.0
许可证
Zig
语言
2024-10-09
创建时间
2026-10-29
最近更新
项目能做什么
tardy 是一个用 Zig 语言编写的高性能异步运行时,主要用于构建高并发的网络应用与服务。它通过线程局部隔离减少资源竞争,提供协程(Frames)调度,并原生支持 io_uring、epoll、kqueue 和 poll 等底层 I/O 多路复用,以此实现低内存分配的异步 Socket 和文件操作。
官方英文简介原文(中文版暂未生成):An asynchronous runtime for writing applications and services. Supports io_uring, epoll, kqueue, and poll for I/O.
来源:基于仓库元数据
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# tardy
tardy *(def: delaying or delayed beyond the right or expected time; late.)* is an asynchronous runtime for writing applications and services in Zig.
Most of the code for this project originated in [zzz](https://github.com/tardy-org/zzz), a performance oriented networking framework.
- tardy utilizes the latest Asynchronous APIs while minimizing allocations.
- tardy natively supports Linux, Mac, BSD, and Windows.
- tardy is configurable, allowing you to optimize the runtime for your specific use-case.
[](https://discord.gg/HNEszT7qSR)
## Summary
tardy is a thread-local, I/O driven runtime for Zig, providing the core implementation for asynchronous libraries and services.
- Per-thread Runtime isolation for minimal contention
- Native async I/O (io_uring, epoll, kqueue, poll, etc.)
- Asynchronous `Socket`s and `File`s.
- Coroutines (internally called Frames).
## Installing
Main line Compatible Zig Version: `0.18.0-dev.738+ae9a8acc7`
```elvish
zig fetch --save 'git+https://github.com/tardy-org/tardy?ref=main#commit_hash'
```
**Else**
Latest Release: `0.3.3` support stable Zig Version `0.17.0`
```elvish
zig fetch --save git+https://github.com/tardy-org/tardy#v0.3.3
```
You can then add the dependency in your `build.zig` file:
```zig
const tardy = b.dependency("tardy", .{
.target = target,
.optimize = optimize,
}).module("tardy");
exe_mod.addImport("tardy", tardy);
```
## Building and Running Examples
- Build/run a specific example
```elvish
zig [build/build run] -Dasync=[async_backend] -Dexample[example_name]
```
- Build all examples
```elvish
zig build -Dexample=all
```
## TCP Example
A basic multi-threaded TCP echo server.
```zig
const std = @import("std");
const options = @import("options");
const tardy = @import("tardy");
const Runtime = tardy.Runtime;
const Socket = tardy.net.Socket;
const AsyncIO = tardy.AsyncIO;
const backend: AsyncIO.Kind = .init(options.async_backend);
const Tardy = tardy.Tardy(backend);
const log = std.log.scoped(.@"tardy/example/echo");
fn echo_frame(rt: *Runtime, server: *const Socket) !void {
const socket = try server.accept(rt);
defer socket.close_blocking();
var sock_reader = socket.reader(rt, &.{});
const sock_r = &sock_reader.interface;
var sock_writer = socket.writer(rt, &.{});
const sock_w = &sock_writer.interface;
defer sock_w.flush() catch unreachable;
const time: std.Io.Timestamp = .now(rt.io, .awake);
log.info(
"{f} - accepted socket [{f}]",
.{ time.untilNow(rt.io, .awake), socket.addr },
);
// spawn off a new frame.
try rt.spawn(echo_frame, .{ rt, server }, .@"16KiB");
var buffer: [501]u8 = undefined;
while (true) {
const recv_length = sock_r.readSliceShort(&buffer) catch |e| {
log.err("Failed to recv on socket | {t}", .{e});
break;
};
if (recv_length == 0) return;
sock_w
阅读完整原文
商业机会分析 规则生成(AI 未配置)
综合评分 35.7 分。该项目在“个人可实施性”维度得 35 分,“付费可能性”维度得 20.0 分,差异化空间 45.0 分(评分依据见评分卡)。
面向细分需求的二次开发产品
| 产品构想 | 基于 tardy 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。 |
| 目标用户 | 该细分场景用户 |
| 难度/周期 | 中 · 2~6 周 |
| 收费模式 | 买断制 / 订阅制 / 广告 |
| 竞争风险 | 细分需求规模需验证 |
| 依据 | AI 推测:基于项目主题标签的判断 |
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| tardy-org/zzz | 中文介绍暂未生成 A framework for writing performant and reliable networked se |
797 | Zig |
| theyakka/tardy | 中文介绍暂未生成 Deal with CLI prompts in style |
41 | Go |
| BohyungPaeng/DRL-Scheduling-tf | 中文介绍暂未生成 Codes implementation of the paper "Deep reinforcement learni |
30 | Python |
| atilaneves/tardy | 中文介绍暂未生成 Runtime polymorphism without inheritance (structs, ints, cla |
29 | D |
| fabio-rovai/tardygrada | 中文介绍暂未生成 A verified runtime for trustworthy AI agents: every claim pa |
26 | C |
| tardy-org/secsock | 中文介绍暂未生成 Async TLS (Secure Socket) for the Tardy runtime |
18 | Zig |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 2024-10-09,近 30 天仍在推送,发布过 9 个 Release |
| 社区活跃 | Star 309 / Fork 23 / Issue 19(数据支持,可自行核实) |
| 许可证 | MPL-2.0 |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/tardy-org/tardy.git cd tardy # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。