userver: userver/storages/redis/request_eval.hpp Source File
Loading...
Searching...
No Matches
request_eval.hpp
1#pragma once
2
3#include <userver/storages/redis/parse_reply.hpp>
4#include <userver/storages/redis/reply.hpp>
5#include <userver/storages/redis/request.hpp>
6
7USERVER_NAMESPACE_BEGIN
8
9namespace storages::redis {
10
11template <typename ScriptResult, typename ReplyType = ScriptResult>
12class [[nodiscard]] RequestEval final {
13 public:
14 explicit RequestEval(RequestEvalCommon&& request)
15 : request_(std::move(request)) {}
16
17 void Wait() { request_.Wait(); }
18
19 void IgnoreResult() const { request_.IgnoreResult(); }
20
21 ReplyType Get(const std::string& request_description = {}) {
22 return ParseReply<ScriptResult, ReplyType>(request_.GetRaw(),
23 request_description);
24 }
25
26 private:
27 RequestEvalCommon request_;
28};
29
30} // namespace storages::redis
31
32USERVER_NAMESPACE_END