sui_rust/ch03/s3_async_runtime.rs
1//! 第三章:Rust 异步编程概念
2//!
3//! # 3.3 异步 运行时
4//!
5//!
6//! - [smol](https://github.com/smol-rs/smol)
7//! - [tokio](https://github.com/tokio-rs/tokio)
8//! - [async-std](https://github.com/async-rs/async-std)
9//! - [bastion](https://github.com/bastion-rs/bastion)
10//! - [glommio](https://github.com/DataDog/glommio)
11//! - [embassy](https://github.com/embassy-rs/embassy)
12//!
13//! 框架剖析:
14//!
15//!
16//! - [rocket](https://github.com/SergioBenitez/Rocket)
17//! - [acitx-web](https://github.com/actix/actix-web)
18//! - [tide](https://github.com/http-rs/tide)
19//! - [lunatic](https://github.com/lunatic-solutions/lunatic)
20//!
21//!
22
23/**
24
25 # 通过学习 smol 建立整体异步编程概念框架
26
27 见 项目 README 图示。soml 的整体架构非常简单和清晰。
28
29 以下是关键组件。
30
31 ## async-task
32
33 对 异步任务 的抽象
34
35 ## async-executor
36
37 异步任务调度和执行,依赖 async-task
38
39 ## async-io
40
41 对接底层I/O,并实现了 Reactor ,依赖 polling
42
43 ## polling
44
45 一层轻薄的 I/O 抽象 API,支持 epoll(Linux/Android)/kqueue(macOS, iOS, FreeBSD, NetBSD, OpenBSD, DragonFly BSD)/event ports(illumos, Solaris)/wepoll(Windows)
46
47 ## blocking
48
49 为异步程序隔离阻塞I/O的线程池。因为像 epoll_wait 实际还是阻塞。
50
51
52*/
53pub fn a_smol_runtime() {}
54
55/**
56
57 # async-std 运行时架构
58
59*/
60pub fn b_async_std_runtime() {}
61
62/**
63
64 # Tokio 运行时 架构
65
66 [io_uring 支持](https://github.com/tokio-rs/tokio-uring/pull/1)
67*/
68pub fn c_tokio_runtime() {}
69
70/**
71
72 # 其他运行时 架构
73
74 - [https://github.com/DataDog/glommio](https://github.com/DataDog/glommio)
75 - [https://github.com/bastion-rs/bastion](https://github.com/bastion-rs/bastion)
76*/
77pub fn d_others_runtime() {}