userver: userver/storages/redis/impl/request.hpp Source File
Loading...
Searching...
No Matches
request.hpp
1#pragma once
2
3#include <chrono>
4
5#include <userver/engine/deadline.hpp>
6#include <userver/engine/future.hpp>
7
8#include <userver/storages/redis/impl/base.hpp>
9#include <userver/storages/redis/impl/types.hpp>
10
11USERVER_NAMESPACE_BEGIN
12
13namespace tracing {
14class Span;
15}
16
17namespace redis {
18
19class Request {
20 public:
21 Request(const Request&) = delete;
22 Request(Request&& r) noexcept = default;
23 Request& operator=(const Request&) = delete;
24 Request& operator=(Request&& r) noexcept = default;
25
26 ReplyPtr Get();
27
28 engine::impl::ContextAccessor* TryGetContextAccessor() noexcept;
29
30 private:
31 friend class Sentinel;
32
33 Request(Sentinel& sentinel, CmdArgs&& args, const std::string& key,
34 bool master, const CommandControl& command_control,
35 size_t replies_to_skip);
36
37 Request(Sentinel& sentinel, CmdArgs&& args, size_t shard, bool master,
38 const CommandControl& command_control, size_t replies_to_skip);
39
40 CommandPtr PrepareRequest(CmdArgs&& args,
41 const CommandControl& command_control,
42 size_t replies_to_skip);
43
44 engine::Future<ReplyPtr> future_;
45 engine::Deadline deadline_;
46};
47
48} // namespace redis
49
50USERVER_NAMESPACE_END