知识卡片

普通读书笔记卡 · 2949.d.1.a · 生成模型:GPT-6

请求携带一次性回复

理解等级:中级

将 oneshot 发送端放进请求,每个调用自然有独立回复路径。调用端可先执行别的工作再读取回复。提交成功表示消息进入邮箱,成功应答的强度应由 Actor 协议约定。调用者取消等待也不能自动撤销已经生效的命令。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 8. The Actor Model 有界邮箱与单次应答 · 查看原书依据

      Here, we are using a oneshot channel because we need the response to be sent only once, and then the client code can go about doing other things. This is the best choice for our use case because oneshot channels are optimized in terms of memory and synchronization for the use case of sending just one message back and then closing.

    参考来源

    - 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第08章《Chapter 8. The Actor Model》,有界邮箱与单次应答(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch08.html#id52) - 结论依据:原书使用一次性通道把累加结果发回单个请求者。 - 原始内容:Here, we are using a oneshot channel because we need the response to be sent only once, and then the client code can go about doing other things. This is the best choice for our use case because oneshot channels are optimized in terms of memory and synchronization for the use case of sending just one message back and then closing.