NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
async_result.hpp 文件参考

完成令牌模型 更多...

#include "NeForce/core/async/promise.hpp"
#include "NeForce/core/exception/exception_ptr.hpp"
#include "NeForce/core/exception/system_exception.hpp"
#include "NeForce/core/functional/function.hpp"
#include "NeForce/core/memory/shared_ptr.hpp"
async_result.hpp 的引用(Include)关系图:

浏览该文件的源代码.

struct  neforce::use_future_t
 返回 future<T> 的完成令牌 更多...
struct  neforce::detached_t
 fire-and-forget 完成令牌 更多...
struct  neforce::deferred_t
 延迟执行完成令牌 更多...
class  neforce::async_result< Token, Signature >
 完成令牌 trait 主模板 更多...

变量

constexpr use_future_t neforce::use_future {}
 use_future 常量
constexpr detached_t neforce::detached {}
 detached 常量
constexpr deferred_t neforce::deferred {}
 deferred 常量

详细描述

完成令牌模型

完成令牌允许同一 async_xxx 函数根据 token 参数返回不同结果类型。

  • 默认(callable):void,handler 即回调
  • use_future:返回 future<Result>
  • detached:fire-and-forget,void
  • deferred:延迟执行,void

在文件 async_result.hpp 中定义.