|
VLink
2.0.0
A high-performance communication middleware
|
Pending-request bookkeeping used to implement blocking RPC calls. More...
#include <memory>#include <mutex>#include <set>#include "../base/condition_variable.h"#include "../base/functional.h"#include "../base/macros.h"Go to the source code of this file.
Classes | |
| class | vlink::AckManager |
| Thread-safe coordinator that pairs RPC requests with their acknowledgements. More... | |
| struct | vlink::AckManager::Request::Compare |
Namespaces | |
| vlink | |
Pending-request bookkeeping used to implement blocking RPC calls.
This is an internal implementation header used by the public Client template and the method-model transport backends; it is not part of the user API. AckManager links the thread that initiates a request with the transport thread that delivers its acknowledgement: callers obtain a RequestPtr, hand it to process() (which both publishes the wire frame through a supplied send callback and blocks on a per-request condition variable), and the matching notify() / remove() call resolves the wait once the response is in flight.
| Method | Caller | Effect |
|---|---|---|
create_request() | RPC caller | Allocates a unique sequence number and pending entry. |
process() | RPC caller | Sends, blocks, returns true on notify(). |
notify() | Transport callback | Removes pending entry and wakes the waiting caller. |
remove() | RPC caller / cleanup | Cancels an entry without waking a waiter. |
clear() | Node shutdown | Aborts all waits and refuses new process() calls. |
reset_interrupted() | Node resume | Re-enables new process() calls after clear(). |
process() calls may be in flight at the same time; each request is tracked independently and is keyed by a monotonically increasing sequence number.