Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

race_in

race_in 在已有任务组内竞速,胜出分支一到就返回,落选分支留给组收尾。头文件 <faio/coroutine/composition.hpp>。

接口

接口行为
race_in(group, tasks...)在任务组内并行启动分支,任意分支先到达 value、error 或 stopped 即胜出,随后停止其余分支并立即返回
index胜出分支在原始参数中的位置
outcome同形状的 std::variant<task_outcome<Ts>...>
loser_error(i)落选分支退出后发布的错误;尚未发布时为空