知识卡片
调度策略外置
同一业务计算可在不同调度环境复用,提交方提供队列与优先级。宏只是统一调用入口,测试仍应覆盖重要工作显式进入目标队列、普通工作使用默认值的语义。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 3. Building Our Own Async Queues 调度参数放在提交处 · 查看原书依据
This macro allows us to pass in just the future. If we pass in only the future, we then pass in the low-priority type, meaning that this is the default type. If the order is passed in, it is passed into the spawn_task function. From this macro, Rust works out that you need to at least pass in the future expression, and it will not
参考来源
- 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第03章《Chapter 3. Building Our Own Async Queues》,调度参数放在提交处(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch03.html#id20)
- 结论依据:宏从提交参数推断默认低优先级,Future 本身不再实现专用标签。
- 原始内容:This macro allows us to pass in just the future. If we pass in only the future, we then pass in the low-priority type, meaning that this is the default type. If the order is passed in, it is passed into the spawn_task function. From this macro, Rust works out that you need to at least pass in the future expression, and it will not