|
VLink
2.0.0
A high-performance communication middleware
|
Handler-side primitive of the VLink method (RPC) communication model. More...
#include <memory>#include <string>#include <type_traits>#include "./base/functional.h"#include "./impl/server_impl.h"#include "./node.h"#include "./internal/server-inl.h"Go to the source code of this file.
Classes | |
| class | vlink::Server< ReqT, RespT, SecT > |
| Type-safe RPC handler for the VLink method communication model. More... | |
| class | vlink::SecurityServer< ReqT, RespT > |
Convenience alias of Server with per-message encryption enabled. More... | |
Namespaces | |
| vlink | |
Handler-side primitive of the VLink method (RPC) communication model.
Server<ReqT, RespT, SecT> registers a handler for inbound RPC requests issued by matching Client instances. Three handler styles are supported: fire-and-forget (no response), synchronous request/response, and deferred asynchronous reply. Codec selection for both the request and the response payload is resolved at compile time.
The class is a thin, header-only template wrapper around ServerImpl.
* Client<Req,Resp> Transport Back-end Server<Req,Resp> * ----------------- ------------------ ----------------- * | invoke(req) | | * |----------------------------->| serialised request | * | |--------------------------->| * | | | handler * | | | fills resp * | | | (sync mode) * | | | -- or -- * | | | store req_id * | | | reply(req_id, resp) * | | | (async mode) * | | serialised response | * | |<---------------------------| * | deserialised response | | * |<-----------------------------| | *
| Method | Handler signature | Semantics |
|---|---|---|
listen(ReqCallback) | void(const ReqT&) | Fire-and-forget; no response. |
listen(ReqRespCallback) | void(const ReqT&, RespT&) | Synchronous fill of resp. |
listen_for_reply(ReqAsyncRespCallback) | void(uint64_t, const Req&) | Deferred reply via reply. |
listen() or listen_for_reply() more than once is a fatal error. reply() must only be used following listen_for_reply(); calling it after a synchronous listen() triggers a fatal log.