标签: poll
与该标签相关的所有文章 "poll".
-
mio(二):核心架构-Poll、Token、Interest、Events
mio 的核心由 6 个类型组成:Poll(事件循环)、Registry(注册表)、Token(事件标识)、Interest(监听意图)、Events(事件集合)、Source trait(可轮询的 I/O 源)。整个 API 没有一个回调函数、没有一个 closure——全靠整数 Token 做事件分发。这是有意为之的设计决策,为了与 Rust 的 ownership 模型兼容。