12#include <userver/storages/redis/impl/types.hpp>
14USERVER_NAMESPACE_BEGIN
20namespace storages::
redis {
32 bool IsAny()
const {
return id_ == -1; }
34 bool operator==(
const ServerId& other)
const {
return other.id_ == id_; }
35 bool operator!=(
const ServerId& other)
const {
return !(other == *
this); }
37 bool operator<(
const ServerId& other)
const {
return id_ < other.id_; }
45 static ServerId Invalid() {
return invalid_; }
47 int64_t GetId()
const {
return id_; }
49 void SetDescription(std::string description)
const;
50 void RemoveDescription()
const;
51 std::string GetDescription()
const;
54 static std::atomic<std::int64_t> next_id_;
61 std::size_t operator()(
ServerId server_id)
const noexcept {
62 return std::hash<std::size_t>{}(server_id.GetId());
130 CommandControl() =
default;
131 CommandControl(std::chrono::milliseconds timeout_single,
132 std::chrono::milliseconds timeout_all, std::size_t max_retries,
134 std::chrono::milliseconds max_ping_latency =
135 std::chrono::milliseconds(0));
141 std::string ToString()
const;
143 friend class Sentinel;