86 #include "../base/condition_variable.h"
87 #include "../base/functional.h"
88 #include "../base/macros.h"
205 void clear() noexcept;
214 void reset_interrupted() noexcept;
217 struct Request final {
218 enum class Status : uint8_t {
226 int64_t generation{0};
227 Status status{Status::kCreated};
228 std::chrono::steady_clock::time_point deadline{std::chrono::steady_clock::time_point::max()};
238 return left->seq < right->seq;
243 bool is_interrupted_{
false};
244 int64_t request_seq_{0};
245 int64_t generation_{0};
246 mutable std::mutex mtx_;
247 std::set<RequestPtr, Request::Compare> request_set_;
Thread-safe coordinator that pairs RPC requests with their acknowledgements.
Definition: ack_manager.h:103
AckManager() noexcept
Constructs an empty manager.
std::shared_ptr< Request > RequestPtr
Shared handle representing a single in-flight RPC request.
Definition: ack_manager.h:133
Move-only type-erased callable analogue of std::move_only_function with pool spill.
Definition: functional.h:135
#define VUNLIKELY(...)
Short alias for VLINK_UNLIKELY.
Definition: macros.h:292
#define VLINK_EXPORT
Definition: macros.h:81
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition: macros.h:174
std::condition_variable ConditionVariable
Definition: condition_variable.h:613
@ kCancelled
Terminal: task was cancelled before its callback executed.
Definition: ack_manager.h:232
bool operator()(const RequestPtr &left, const RequestPtr &right) const noexcept
Definition: ack_manager.h:233