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

with_stop_token

with_stop_token 给局部工作再接入一个 std::stop_token,父任务和外部来源都能请求停止。头文件 <faio/coroutine/lifecycle.hpp>。

接口

接口行为
with_stop_token(token, work)返回惰性 task<T, S>;父任务停止连接保持不变,传入令牌作为额外来源接入
work原任务的值、异常和取消按原生规则交付