知识卡片

普通读书笔记卡 · 303.a.3.b.3 · 生成模型:GPT-6

执行器与连接器分工

理解等级:中级

接入 HTTP 库时,先识别协议层需要的任务提交接口和 I/O 来源。只替换执行器,连接建立、DNS 或定时器仍可能引用默认运行时。示例通过 Executor 把内部 Future 提交到自制队列,再由 Connector 返回适配过的异步流。关联 [[运行令牌与结果句柄]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第04章《Chapter 4. Integrating Networking into Our Own Async Runtime》,执行器、连接器与 reactor(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch04.html#id81) - 结论依据:原书在自制运行时中遇到默认 reactor 缺失,分别替换任务执行与连接组件。 - 原始内容:To address the issue, we will create a custom executor that can handle our tasks within the custom async runtime we’ve built. Then we’ll build a custom connector to manage the actual network connections, allowing our runtime to seamlessly integrate with hyper and other similar libraries.