|
faio
faio 公共 C++ 接口参考
|
由调用线程驱动的独立运行时。 更多...
Public 类型 | |
| using | scheduler_type = default_scheduler |
| 此实例接受的 task 使用的调度器类型。 | |
Public 成员函数 | |
| current_thread_runtime (faio::runtime::config config={}) | |
| 构造current_thread_runtime对象。 | |
| template<class T> | |
| T | block_on (task< T, scheduler_type > child) |
| 在普通线程驱动并等待一个异步任务组。 | |
| template<class T> | |
| join_handle< T, scheduler_type > | spawn (task< T, scheduler_type > child) |
| 立即提交一个独立并发任务。 | |
| template<class T> | |
| void | submit (task< T, scheduler_type > child) |
| 将任务提交给此实例。 | |
| template<class... Ts> | |
| std::tuple< Ts... > | wait_all (task< Ts, scheduler_type >... children) |
| 在此实例中等待一组任务全部完成。 | |
| template<class F> | |
| auto | spawn_blocking (F &&function) |
| 把同步函数提交到独立的有界阻塞线程池。 | |
| void | request_stop () noexcept |
| 请求相关任务协作停止。 | |
| void | shutdown (io::shutdown_policy policy=io::shutdown_policy::cancel_all) |
| 按指定策略关闭此实例。 | |
| void | stop (io::shutdown_policy policy=io::shutdown_policy::drain) |
| 停止接纳并按策略排空此实例的工作。 | |
由调用线程驱动的独立运行时。
|
explicit |
构造current_thread_runtime对象。
| config | 实例的运行时配置,驱动模式由所构造的类型决定。 默认值:{}。 |
| T faio::runtime::current_thread_runtime::block_on | ( | task< T, scheduler_type > | child | ) |
在普通线程驱动并等待一个异步任务组。
| child | 移动提交的惰性子任务;提交后调用方不再拥有它。 |
| join_handle< T, scheduler_type > faio::runtime::current_thread_runtime::spawn | ( | task< T, scheduler_type > | child | ) |
立即提交一个独立并发任务。
| child | 移动提交的惰性子任务;提交后调用方不再拥有它。 |
| void faio::runtime::current_thread_runtime::submit | ( | task< T, scheduler_type > | child | ) |
将任务提交给此实例。
| child | 移动提交的惰性子任务;提交后调用方不再拥有它。 |
| std::tuple< Ts... > faio::runtime::current_thread_runtime::wait_all | ( | task< Ts, scheduler_type >... | children | ) |
在此实例中等待一组任务全部完成。
| children | 移动传入的子任务参数包或任务集合,结果顺序对应输入顺序。 |
| auto faio::runtime::current_thread_runtime::spawn_blocking | ( | F && | function | ) |
把同步函数提交到独立的有界阻塞线程池。
| function | 执行所需工作的可调用对象;阻塞任务按值保存,非阻塞 I/O 回调不得阻塞。 |
|
noexcept |
请求相关任务协作停止。
| void faio::runtime::current_thread_runtime::shutdown | ( | io::shutdown_policy | policy = io::shutdown_policy::cancel_all | ) |
| void faio::runtime::current_thread_runtime::stop | ( | io::shutdown_policy | policy = io::shutdown_policy::drain | ) |