10#include <condition_variable>
14#include <unordered_set>
25using namespace std::string_view_literals;
42#if __linux__ || __APPLE__ || __sun
46#include "tbb/tbb_config.h"
48#include "tbb/machine/windows_api.h"
55#include __TBB_STD_SWAP_HEADER
58#include "tbb/tbb_allocator.h"
59#include "tbb/parallel_for.h"
60#include "tbb/concurrent_unordered_map.h"
62#include "tbb/concurrent_vector.h"
71#include <hiredis/hiredis.h>
75static const char* reply_types[] = {
85#define RD_ARRAY_PRINT(cmd,...){\
86 redisReply* _reply = (redisReply*)redisCommand(c, cmd,__VA_ARGS__);\
87 if( (_reply!=NULL) & (_reply->type == REDIS_REPLY_ARRAY)) {\
88 for (int j = 0; j < _reply->elements; j++) {\
89 printf("%u) %s\n", j, _reply->element[j]->str);\
91 }; freeReplyObject(_reply); }
92#define RD_CHECK(X) if ( !X || X->type == REDIS_REPLY_ERROR ) { printf("Error\n"); exit(-1); }
93#define RD_REPLY_PRINT(reply)printf("res: %s, num: %zu, type: %s\n", reply->str, reply->elements,reply_types[ reply->type ]);