百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

libae

> 数据库
开源

Redis 的异步事件循环库

191 stars0 点赞6 次浏览
访问官网GitHub

工具介绍

Redis 的异步事件循环库

libae

Redis's async event library, extracted as a small reusable C library. This copy is taken from Redis 7.2, the last Redis release still distributed under the BSD license.

Supported Event Multiplexing Models

  • epoll
  • kqueue
  • evport
  • select

The backend is selected at compile time according to platform support.

Build

Build the static library:

bash
make libae.a

Build the static library with CMake:

bash
cmake -S . -B build
cmake --build build --target ae

Build the bundled examples:

bash
make timer
make echo

Build the bundled examples with CMake:

bash
cmake -S . -B build
cmake --build build

Build everything:

bash
make all

Clean generated files:

bash
make clean

Install the library and exported CMake target files:

bash
cmake -S . -B build
cmake --build build
cmake --install build

Examples

Timer

The timer example registers multiple time events and prints a message roughly once per second:

bash
make timer
./timer

See example/timer.c for the full source.

Echo Server

The echo example starts a TCP server on port 8000:

bash
make echo
./echo

Then connect from another terminal:

bash
nc 127.0.0.1 8000

See example/echo.c for the full source.

Source Layout

  • src/ae.c and src/ae.h: core event loop implementation and public API
  • src/anet.c and src/anet.h: networking helpers
  • src/monotonic.c and src/monotonic.h: monotonic clock helpers
  • src/ae_epoll.c, src/ae_kqueue.c, src/ae_evport.c, src/ae_select.c: backend-specific pollers
  • example/: runnable examples

Notes

This repository currently builds a static library (libae.a) and two example binaries (timer, echo).

Original document

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Casyncioceventsnetwork

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库