|
VLink 2.0.0
A high-performance communication middleware
|
Type-safe method-model client (caller side) for VLink RPC. 更多...
#include <chrono>#include <functional>#include <future>#include <memory>#include <mutex>#include <optional>#include <string>#include <unordered_map>#include "./impl/client_impl.h"#include "./node.h"#include "./internal/client-inl.h"类 | |
| class | vlink::Client< ReqT, RespT, SecT > |
| Type-safe client for the VLink method (RPC) communication model. 更多... | |
| class | vlink::SecurityClient< ReqT, RespT > |
Convenience alias for Client with message security enabled. 更多... | |
命名空间 | |
| namespace | vlink |
Type-safe method-model client (caller side) for VLink RPC.
Client<ReqT, RespT, SecT> is the caller side of the VLink method model. It serialises a request, delivers it to a matching Server, and returns the deserialised response.
| Method | Signature | Block | Notes |
|---|---|---|---|
invoke (ref) | invoke(req, resp&, timeout) | Yes | Returns true/false. |
invoke (optional) | invoke(req, timeout) -> optional<Resp> | Yes | Returns nullopt on timeout. |
invoke (callback) | invoke(req, RespCallback) | No | Callback on response. |
async_invoke | async_invoke(req) -> future<Resp> | No | std::future based. |
send | send(req) | No | Fire-and-forget (no resp). |
0 is treated as infinite (a warning is logged). send() is only valid when RespT == EmptyType. invoke() / async_invoke() are only valid when kHasResp is true.| ReqT | Request message type. Must satisfy Serializer::is_supported(). |
| RespT | Response type. Defaults to Traits::EmptyType (fire-and-forget). |
| SecT | Security mode; defaults to SecurityType::kWithoutSecurity. |