userver: userver/storages/redis/client.hpp Source File
Loading...
Searching...
No Matches
client.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/storages/redis/client.hpp
4/// @brief @copybrief storages::redis::Client
5
6#include <chrono>
7#include <memory>
8#include <string>
9
10#include <userver/storages/redis/base.hpp>
11#include <userver/storages/redis/wait_connected_mode.hpp>
12
13#include <userver/storages/redis/bit_operation.hpp>
14#include <userver/storages/redis/client_fwd.hpp>
15#include <userver/storages/redis/command_options.hpp>
16#include <userver/storages/redis/request.hpp>
17#include <userver/storages/redis/request_eval.hpp>
18#include <userver/storages/redis/request_evalsha.hpp>
19#include <userver/storages/redis/request_generic.hpp>
20#include <userver/storages/redis/transaction.hpp>
21
22USERVER_NAMESPACE_BEGIN
23
24namespace storages::redis {
25
26enum class PubShard {
27 kZeroShard,
28 kRoundRobin,
29};
30
31/// @ingroup userver_clients
32///
33/// @brief Valkey or Redis client.
34///
35/// Usually retrieved from components::Redis component.
36///
37/// ## Example usage:
38///
39/// @snippet storages/redis/client_redistest.cpp Sample Redis Client usage
40class Client {
41public:
42 virtual ~Client() = default;
43
44 virtual size_t ShardsCount() const = 0;
45 virtual bool IsInClusterMode() const = 0;
46
47 virtual size_t ShardByKey(const std::string& key) const = 0;
48
49 void CheckShardIdx(size_t shard_idx) const;
50
51 virtual void WaitConnectedOnce(RedisWaitConnected wait_connected) = 0;
52
53 // redis commands:
54
55 virtual RequestAppend Append(std::string key, std::string value, const CommandControl& command_control) = 0;
56
57 virtual RequestBitop Bitop(
58 BitOperation op,
59 std::string dest_key,
60 std::vector<std::string> src_keys,
61 const CommandControl& command_control
62 ) = 0;
63
64 virtual RequestDbsize Dbsize(size_t shard, const CommandControl& command_control) = 0;
65
66 virtual RequestDecr Decr(std::string key, const CommandControl& command_control) = 0;
67
68 virtual RequestDel Del(std::string key, const CommandControl& command_control) = 0;
69
70 virtual RequestDel Del(std::vector<std::string> keys, const CommandControl& command_control) = 0;
71
72 virtual RequestUnlink Unlink(std::string key, const CommandControl& command_control) = 0;
73
74 virtual RequestUnlink Unlink(std::vector<std::string> keys, const CommandControl& command_control) = 0;
75
76 /// @brief Invoke the execution of a server-side Lua script.
77 ///
78 /// For huge scripts consider EvalSha() to save network bandwidth.
79 ///
80 /// Sample usage:
81 /// @snippet redis/src/storages/redis/client_cluster_redistest.cpp Sample eval usage
82 template <typename ScriptResult, typename ReplyType = ScriptResult>
83 RequestEval<ScriptResult, ReplyType> Eval(
84 std::string script,
85 std::vector<std::string> keys,
86 std::vector<std::string> args,
87 const CommandControl& command_control
88 ) {
89 return RequestEval<ScriptResult, ReplyType>{
90 EvalCommon(std::move(script), std::move(keys), std::move(args), command_control)
91 };
92 }
93
94 /// @brief Invoke the execution of a server-side Lua script that was previously uploaded to the server via
95 /// ScriptLoad() member function.
96 ///
97 /// For small scripts consider using a simpler Eval() member function.
98 ///
99 /// Sample usage:
100 /// @snippet redis/src/storages/redis/client_cluster_redistest.cpp Sample evalsha usage
101 template <typename ScriptResult, typename ReplyType = ScriptResult>
102 RequestEvalSha<ScriptResult, ReplyType> EvalSha(
103 std::string script_hash,
104 std::vector<std::string> keys,
105 std::vector<std::string> args,
106 const CommandControl& command_control
107 ) {
108 return RequestEvalSha<ScriptResult, ReplyType>{
109 EvalShaCommon(std::move(script_hash), std::move(keys), std::move(args), command_control)
110 };
111 }
112
113 /// @brief This is a read-only variant of the Eval() command that cannot execute commands that modify data.
114 ///
115 /// For huge scripts consider EvalShaReadOnly() to save network bandwidth.
116 ///
117 /// Sample usage:
118 /// @snippet redis/src/storages/redis/client_cluster_redistest.cpp Sample eval_ro usage
119 template <typename ScriptResult, typename ReplyType = ScriptResult>
120 RequestEval<ScriptResult, ReplyType> EvalReadOnly(
121 std::string script,
122 std::vector<std::string> keys,
123 std::vector<std::string> args,
124 const CommandControl& command_control
125 ) {
126 return RequestEval<ScriptResult, ReplyType>{
127 EvalReadOnlyCommon(std::move(script), std::move(keys), std::move(args), command_control)
128 };
129 }
130
131 /// @brief This is a read-only variant of the EvalSha() command that cannot execute commands that modify data.
132 ///
133 /// For small scripts consider using a simpler EvalReadOnly() member function.
134 ///
135 /// Sample usage:
136 /// @snippet redis/src/storages/redis/client_cluster_redistest.cpp Sample evalsha_ro usage
137 template <typename ScriptResult, typename ReplyType = ScriptResult>
138 RequestEvalSha<ScriptResult, ReplyType> EvalShaReadOnly(
139 std::string script_hash,
140 std::vector<std::string> keys,
141 std::vector<std::string> args,
142 const CommandControl& command_control
143 ) {
144 return RequestEvalSha<ScriptResult, ReplyType>{
145 EvalShaReadOnlyCommon(std::move(script_hash), std::move(keys), std::move(args), command_control)
146 };
147 }
148
149 /// @brief Execute a custom Redis command.
150 /// @param key_index Index of the key in the args vector used to determine the shard
151 ///
152 /// Sample usage:
153 /// @snippet redis/src/storages/redis/client_cluster_redistest.cpp Sample generic command usage
154 template <typename ReplyType>
155 RequestGeneric<ReplyType> GenericCommand(
156 std::string command,
157 std::vector<std::string> args,
158 size_t key_index,
159 const CommandControl& command_control
160 ) {
161 return RequestGeneric<ReplyType>{GenericCommon(std::move(command), std::move(args), key_index, command_control)
162 };
163 }
164
165 /// @brief Load the script to the server for further execution via EvalSha() member function.
166 ///
167 /// Sample usage:
168 /// @snippet redis/src/storages/redis/client_cluster_redistest.cpp Sample evalsha usage
169 virtual RequestScriptLoad ScriptLoad(std::string script, size_t shard, const CommandControl& command_control) = 0;
170
171 /// @overload
172 template <typename ScriptInfo, typename ReplyType = std::decay_t<ScriptInfo>>
173 RequestEval<std::decay_t<ScriptInfo>, ReplyType> Eval(
174 const ScriptInfo& script_info,
175 std::vector<std::string> keys,
176 std::vector<std::string> args,
177 const CommandControl& command_control
178 ) {
179 return RequestEval<std::decay_t<ScriptInfo>, ReplyType>{
180 EvalCommon(script_info.GetScript(), std::move(keys), std::move(args), command_control)
181 };
182 }
183
184 virtual RequestExists Exists(std::string key, const CommandControl& command_control) = 0;
185
186 virtual RequestExists Exists(std::vector<std::string> keys, const CommandControl& command_control) = 0;
187
188 virtual RequestExpire Expire(std::string key, std::chrono::seconds ttl, const CommandControl& command_control) = 0;
189
190 virtual RequestExpire Expire(
191 std::string key,
192 std::chrono::seconds ttl,
193 ExpireOptions options,
194 const CommandControl& command_control
195 ) = 0;
196
197 virtual RequestGeoadd Geoadd(std::string key, GeoaddArg point_member, const CommandControl& command_control) = 0;
198
199 virtual RequestGeoadd Geoadd(
200 std::string key,
201 std::vector<GeoaddArg> point_members,
202 const CommandControl& command_control
203 ) = 0;
204
205 virtual RequestGeopos Geopos(
206 std::string key,
207 std::vector<std::string> members,
208 const CommandControl& command_control
209 ) = 0;
210
211 virtual RequestGeoradius Georadius(
212 std::string key,
213 Longitude lon,
214 Latitude lat,
215 double radius,
216 const GeoradiusOptions& georadius_options,
217 const CommandControl& command_control
218 ) = 0;
219
220 virtual RequestGeosearch Geosearch(
221 std::string key,
222 std::string member,
223 double radius,
224 const GeosearchOptions& geosearch_options,
225 const CommandControl& command_control
226 ) = 0;
227
228 virtual RequestGeosearch Geosearch(
229 std::string key,
230 std::string member,
231 BoxWidth width,
232 BoxHeight height,
233 const GeosearchOptions& geosearch_options,
234 const CommandControl& command_control
235 ) = 0;
236
237 virtual RequestGeosearch Geosearch(
238 std::string key,
239 Longitude lon,
240 Latitude lat,
241 double radius,
242 const GeosearchOptions& geosearch_options,
243 const CommandControl& command_control
244 ) = 0;
245
246 virtual RequestGeosearch Geosearch(
247 std::string key,
248 Longitude lon,
249 Latitude lat,
250 BoxWidth width,
251 BoxHeight height,
252 const GeosearchOptions& geosearch_options,
253 const CommandControl& command_control
254 ) = 0;
255
256 virtual RequestGet Get(std::string key, const CommandControl& command_control) = 0;
257
258 virtual RequestGetset Getset(std::string key, std::string value, const CommandControl& command_control) = 0;
259
260 virtual RequestHdel Hdel(std::string key, std::string field, const CommandControl& command_control) = 0;
261
262 virtual RequestHdel Hdel(
263 std::string key,
264 std::vector<std::string> fields,
265 const CommandControl& command_control
266 ) = 0;
267
268 virtual RequestHexists Hexists(std::string key, std::string field, const CommandControl& command_control) = 0;
269
270 virtual RequestHget Hget(std::string key, std::string field, const CommandControl& command_control) = 0;
271
272 // use Hscan in case of a big hash
273 virtual RequestHgetall Hgetall(std::string key, const CommandControl& command_control) = 0;
274
275 virtual RequestHincrby Hincrby(
276 std::string key,
277 std::string field,
278 int64_t increment,
279 const CommandControl& command_control
280 ) = 0;
281
282 virtual RequestHincrbyfloat Hincrbyfloat(
283 std::string key,
284 std::string field,
285 double increment,
286 const CommandControl& command_control
287 ) = 0;
288
289 // use Hscan in case of a big hash
290 virtual RequestHkeys Hkeys(std::string key, const CommandControl& command_control) = 0;
291
292 virtual RequestHlen Hlen(std::string key, const CommandControl& command_control) = 0;
293
294 virtual RequestHmget Hmget(
295 std::string key,
296 std::vector<std::string> fields,
297 const CommandControl& command_control
298 ) = 0;
299
300 virtual RequestHmset Hmset(
301 std::string key,
302 std::vector<std::pair<std::string, std::string>> field_values,
303 const CommandControl& command_control
304 ) = 0;
305
306 /// @brief Iterate over a collection of elements.
307 ///
308 /// Sample usage:
309 /// @snippet redis/src/storages/redis/client_scan_redistest.cpp Sample Hscan usage
310 virtual RequestHscan Hscan(std::string key, HscanOptions options, const CommandControl& command_control) = 0;
311
312 virtual RequestHset Hset(
313 std::string key,
314 std::string field,
315 std::string value,
316 const CommandControl& command_control
317 ) = 0;
318
319 virtual RequestHsetnx Hsetnx(
320 std::string key,
321 std::string field,
322 std::string value,
323 const CommandControl& command_control
324 ) = 0;
325
326 // use Hscan in case of a big hash
327 virtual RequestHvals Hvals(std::string key, const CommandControl& command_control) = 0;
328
329 virtual RequestIncr Incr(std::string key, const CommandControl& command_control) = 0;
330
331 [[deprecated("use Scan")]] virtual RequestKeys Keys(
332 std::string keys_pattern,
333 size_t shard,
334 const CommandControl& command_control
335 ) = 0;
336
337 virtual RequestLindex Lindex(std::string key, int64_t index, const CommandControl& command_control) = 0;
338
339 virtual RequestLlen Llen(std::string key, const CommandControl& command_control) = 0;
340
341 virtual RequestLpop Lpop(std::string key, const CommandControl& command_control) = 0;
342
343 virtual RequestLpush Lpush(std::string key, std::string value, const CommandControl& command_control) = 0;
344
345 virtual RequestLpush Lpush(
346 std::string key,
347 std::vector<std::string> values,
348 const CommandControl& command_control
349 ) = 0;
350
351 virtual RequestLpushx Lpushx(std::string key, std::string element, const CommandControl& command_control) = 0;
352
353 virtual RequestLrange Lrange(
354 std::string key,
355 int64_t start,
356 int64_t stop,
357 const CommandControl& command_control
358 ) = 0;
359
360 virtual RequestLrem Lrem(
361 std::string key,
362 int64_t count,
363 std::string element,
364 const CommandControl& command_control
365 ) = 0;
366
367 virtual RequestLtrim Ltrim(std::string key, int64_t start, int64_t stop, const CommandControl& command_control) = 0;
368
369 virtual RequestMget Mget(std::vector<std::string> keys, const CommandControl& command_control) = 0;
370
371 virtual RequestMset Mset(
372 std::vector<std::pair<std::string, std::string>> key_values,
373 const CommandControl& command_control
374 ) = 0;
375
376 virtual TransactionPtr Multi() = 0;
377
378 virtual TransactionPtr Multi(Transaction::CheckShards check_shards) = 0;
379
380 virtual RequestPersist Persist(std::string key, const CommandControl& command_control) = 0;
381
382 virtual RequestPexpire Pexpire(
383 std::string key,
384 std::chrono::milliseconds ttl,
385 const CommandControl& command_control
386 ) = 0;
387
388 virtual RequestPing Ping(size_t shard, const CommandControl& command_control) = 0;
389
390 virtual RequestPingMessage Ping(size_t shard, std::string message, const CommandControl& command_control) = 0;
391
392 virtual void Publish(
393 std::string channel,
394 std::string message,
395 const CommandControl& command_control,
396 PubShard policy
397 ) = 0;
398
399 virtual void Spublish(std::string channel, std::string message, const CommandControl& command_control) = 0;
400
401 virtual RequestRename Rename(std::string key, std::string new_key, const CommandControl& command_control) = 0;
402
403 virtual RequestRpop Rpop(std::string key, const CommandControl& command_control) = 0;
404
405 virtual RequestRpush Rpush(std::string key, std::string value, const CommandControl& command_control) = 0;
406
407 virtual RequestRpush Rpush(
408 std::string key,
409 std::vector<std::string> values,
410 const CommandControl& command_control
411 ) = 0;
412
413 virtual RequestRpushx Rpushx(std::string key, std::string element, const CommandControl& command_control) = 0;
414
415 /// @brief Add member to a set of elements.
416 ///
417 /// Sample usage:
418 /// @snippet redis/src/storages/redis/client_scan_redistest.cpp Sample Sadd and Sscan usage
419 virtual RequestSadd Sadd(std::string key, std::string member, const CommandControl& command_control) = 0;
420
421 /// @overload
422 virtual RequestSadd Sadd(
423 std::string key,
424 std::vector<std::string> members,
425 const CommandControl& command_control
426 ) = 0;
427
428 /// @brief Iterate over a collection of elements.
429 ///
430 /// Sample usage:
431 /// @snippet redis/src/storages/redis/client_scan_redistest.cpp Sample Scan usage
432 virtual RequestScan Scan(size_t shard, ScanOptions options, const CommandControl& command_control) = 0;
433
434 virtual RequestScard Scard(std::string key, const CommandControl& command_control) = 0;
435
436 virtual RequestSet Set(std::string key, std::string value, const CommandControl& command_control) = 0;
437
438 virtual RequestSet Set(
439 std::string key,
440 std::string value,
441 std::chrono::milliseconds ttl,
442 const CommandControl& command_control
443 ) = 0;
444
445 virtual RequestSetIfExist SetIfExist(std::string key, std::string value, const CommandControl& command_control) = 0;
446
447 virtual RequestSetIfExist SetIfExist(
448 std::string key,
449 std::string value,
450 std::chrono::milliseconds ttl,
451 const CommandControl& command_control
452 ) = 0;
453
454 virtual RequestSetIfNotExist SetIfNotExist(
455 std::string key,
456 std::string value,
457 const CommandControl& command_control
458 ) = 0;
459
460 virtual RequestSetIfNotExist SetIfNotExist(
461 std::string key,
462 std::string value,
463 std::chrono::milliseconds ttl,
464 const CommandControl& command_control
465 ) = 0;
466
467 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(
468 std::string key,
469 std::string value,
470 const CommandControl& command_control
471 ) = 0;
472
473 virtual RequestSetIfNotExistOrGet SetIfNotExistOrGet(
474 std::string key,
475 std::string value,
476 std::chrono::milliseconds ttl,
477 const CommandControl& command_control
478 ) = 0;
479
480 virtual RequestSetex Setex(
481 std::string key,
482 std::chrono::seconds seconds,
483 std::string value,
484 const CommandControl& command_control
485 ) = 0;
486
487 virtual RequestSismember Sismember(std::string key, std::string member, const CommandControl& command_control) = 0;
488
489 // use Sscan in case of a big set
490 virtual RequestSmembers Smembers(std::string key, const CommandControl& command_control) = 0;
491
492 virtual RequestSrandmember Srandmember(std::string key, const CommandControl& command_control) = 0;
493
494 virtual RequestSrandmembers Srandmembers(std::string key, int64_t count, const CommandControl& command_control) = 0;
495
496 virtual RequestSrem Srem(std::string key, std::string member, const CommandControl& command_control) = 0;
497
498 virtual RequestSrem Srem(
499 std::string key,
500 std::vector<std::string> members,
501 const CommandControl& command_control
502 ) = 0;
503
504 /// @brief Iterate over a collection of elements.
505 ///
506 /// Sample usage:
507 /// @snippet redis/src/storages/redis/client_scan_redistest.cpp Sample Sadd and Sscan usage
508 virtual RequestSscan Sscan(std::string key, SscanOptions options, const CommandControl& command_control) = 0;
509
510 virtual RequestStrlen Strlen(std::string key, const CommandControl& command_control) = 0;
511
512 virtual RequestTime Time(size_t shard, const CommandControl& command_control) = 0;
513
514 virtual RequestTtl Ttl(std::string key, const CommandControl& command_control) = 0;
515
516 virtual RequestType Type(std::string key, const CommandControl& command_control) = 0;
517
518 virtual RequestZadd Zadd(
519 std::string key,
520 double score,
521 std::string member,
522 const CommandControl& command_control
523 ) = 0;
524
525 virtual RequestZadd Zadd(
526 std::string key,
527 double score,
528 std::string member,
529 const ZaddOptions& options,
530 const CommandControl& command_control
531 ) = 0;
532
533 virtual RequestZadd Zadd(
534 std::string key,
535 std::vector<std::pair<double, std::string>> scored_members,
536 const CommandControl& command_control
537 ) = 0;
538
539 virtual RequestZadd Zadd(
540 std::string key,
541 std::vector<std::pair<double, std::string>> scored_members,
542 const ZaddOptions& options,
543 const CommandControl& command_control
544 ) = 0;
545
546 virtual RequestZaddIncr ZaddIncr(
547 std::string key,
548 double score,
549 std::string member,
550 const CommandControl& command_control
551 ) = 0;
552
553 virtual RequestZaddIncrExisting ZaddIncrExisting(
554 std::string key,
555 double score,
556 std::string member,
557 const CommandControl& command_control
558 ) = 0;
559
560 virtual RequestZcard Zcard(std::string key, const CommandControl& command_control) = 0;
561
562 virtual RequestZcount Zcount(std::string key, double min, double max, const CommandControl& command_control) = 0;
563
564 virtual RequestZrange Zrange(
565 std::string key,
566 int64_t start,
567 int64_t stop,
568 const CommandControl& command_control
569 ) = 0;
570
571 virtual RequestZrangeWithScores ZrangeWithScores(
572 std::string key,
573 int64_t start,
574 int64_t stop,
575 const CommandControl& command_control
576 ) = 0;
577
578 virtual RequestZrangebyscore Zrangebyscore(
579 std::string key,
580 double min,
581 double max,
582 const CommandControl& command_control
583 ) = 0;
584
585 virtual RequestZrangebyscore Zrangebyscore(
586 std::string key,
587 std::string min,
588 std::string max,
589 const CommandControl& command_control
590 ) = 0;
591
592 virtual RequestZrangebyscore Zrangebyscore(
593 std::string key,
594 double min,
595 double max,
596 const RangeOptions& range_options,
597 const CommandControl& command_control
598 ) = 0;
599
600 virtual RequestZrangebyscore Zrangebyscore(
601 std::string key,
602 std::string min,
603 std::string max,
604 const RangeOptions& range_options,
605 const CommandControl& command_control
606 ) = 0;
607
608 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
609 std::string key,
610 double min,
611 double max,
612 const CommandControl& command_control
613 ) = 0;
614
615 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
616 std::string key,
617 std::string min,
618 std::string max,
619 const CommandControl& command_control
620 ) = 0;
621
622 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
623 std::string key,
624 double min,
625 double max,
626 const RangeOptions& range_options,
627 const CommandControl& command_control
628 ) = 0;
629
630 virtual RequestZrangebyscoreWithScores ZrangebyscoreWithScores(
631 std::string key,
632 std::string min,
633 std::string max,
634 const RangeOptions& range_options,
635 const CommandControl& command_control
636 ) = 0;
637
638 virtual RequestZrem Zrem(std::string key, std::string member, const CommandControl& command_control) = 0;
639
640 virtual RequestZrem Zrem(
641 std::string key,
642 std::vector<std::string> members,
643 const CommandControl& command_control
644 ) = 0;
645
646 virtual RequestZremrangebyrank Zremrangebyrank(
647 std::string key,
648 int64_t start,
649 int64_t stop,
650 const CommandControl& command_control
651 ) = 0;
652
653 virtual RequestZremrangebyscore Zremrangebyscore(
654 std::string key,
655 double min,
656 double max,
657 const CommandControl& command_control
658 ) = 0;
659
660 virtual RequestZremrangebyscore Zremrangebyscore(
661 std::string key,
662 std::string min,
663 std::string max,
664 const CommandControl& command_control
665 ) = 0;
666
667 /// @brief Iterate over a collection of elements.
668 ///
669 /// Sample usage:
670 /// @snippet redis/src/storages/redis/client_scan_redistest.cpp Sample Zscan usage
671 virtual RequestZscan Zscan(std::string key, ZscanOptions options, const CommandControl& command_control) = 0;
672
673 virtual RequestZscore Zscore(std::string key, std::string member, const CommandControl& command_control) = 0;
674
675 // end of redis commands
676
677 RequestGet Get(std::string key, RetryNilFromMaster, const CommandControl& command_control);
678
679 RequestHget Hget(std::string key, std::string field, RetryNilFromMaster, const CommandControl& command_control);
680
681 RequestZscore Zscore(
682 std::string key,
683 std::string member,
685 const CommandControl& command_control
686 );
687
688 void Publish(std::string channel, std::string message, const CommandControl& command_control);
689
690 RequestScan Scan(size_t shard, const CommandControl& command_control);
691
692 RequestHscan Hscan(std::string key, const CommandControl& command_control);
693
694 RequestSscan Sscan(std::string key, const CommandControl& command_control);
695
696 RequestZscan Zscan(std::string key, const CommandControl& command_control);
697
698protected:
699 virtual RequestEvalCommon EvalCommon(
700 std::string script,
701 std::vector<std::string> keys,
702 std::vector<std::string> args,
703 const CommandControl& command_control
704 ) = 0;
705 virtual RequestEvalShaCommon EvalShaCommon(
706 std::string script_hash,
707 std::vector<std::string> keys,
708 std::vector<std::string> args,
709 const CommandControl& command_control
710 ) = 0;
711 virtual RequestEvalCommon EvalReadOnlyCommon(
712 std::string script,
713 std::vector<std::string> keys,
714 std::vector<std::string> args,
715 const CommandControl& command_control
716 ) = 0;
717 virtual RequestEvalShaCommon EvalShaReadOnlyCommon(
718 std::string script_hash,
719 std::vector<std::string> keys,
720 std::vector<std::string> args,
721 const CommandControl& command_control
722 ) = 0;
723 virtual RequestGenericCommon GenericCommon(
724 std::string command,
725 std::vector<std::string> args,
726 size_t key_index,
727 const CommandControl& command_control
728 ) = 0;
729};
730
731std::string CreateTmpKey(const std::string& key, std::string prefix);
732
733} // namespace storages::redis
734
735USERVER_NAMESPACE_END