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

libae

> 数据库
Open source

redis's async event loop library

191 stars0 likes6 views
WebsiteGitHub

About

redis's async event loop library

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Casyncioceventsnetwork

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category数据库
PricingOpen source

> Related tools

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