compat.redis-plus-plus
C++ client for Redis (sync API; built from source, depends on compat.hiredis)
mcpp add compat.redis-plus-plus@1.3.13
Usage
From this repository's own test project — built and run by CI, not written for the website.
// redis_test.cpp — offline behavioral test for compat.redis-plus-plus.
//
// No redis-server binary and no network access: this test runs a minimal RESP
// server inside the process (raw loopback sockets, same platform abstraction
// as the websocket member) and drives the sw::redis::Redis sync client against
// it. That exercises the full stack the package must get right:
// * both static libs actually link (redis++ + hiredis),
// * hiredis connects and speaks the RESP protocol (PING -> +PONG),
// * redis++ formats commands (SET -> +OK) and parses replies back to C++.
#include <sw/redis++/redis++.h>
#include <atomic>
#include <chrono>
#include <cstdint>
#include <iostream>
#include <string>
#include <string_view>
#include <thread>
// ── Platform socket abstraction (same as tests/examples/websocket) ─────────
#ifdef _WIN32
// …
tests/examples/redis-plus-plus-v133/tests/redis_test.cpp · project tests/examples/redis-plus-plus-v133
Build
- targets
redis_plus_plus (lib)- language
c++23- import std
- no
- include dirs
*/src, */src/sw/redis++/cxx17, */src/sw/redis++/no_tls, mcpp_generated
Sources (17)
*/src/sw/redis++/command.cpp*/src/sw/redis++/command_options.cpp*/src/sw/redis++/connection.cpp*/src/sw/redis++/connection_pool.cpp*/src/sw/redis++/crc16.cpp*/src/sw/redis++/errors.cpp*/src/sw/redis++/pipeline.cpp*/src/sw/redis++/redis.cpp*/src/sw/redis++/redis_cluster.cpp*/src/sw/redis++/redis_uri.cpp*/src/sw/redis++/reply.cpp*/src/sw/redis++/sentinel.cpp*/src/sw/redis++/shards.cpp*/src/sw/redis++/shards_pool.cpp*/src/sw/redis++/subscriber.cpp*/src/sw/redis++/transaction.cpp*/src/sw/redis++/patterns/redlock.cpp
Generated files
mcpp_generated/sw/redis++/hiredis_features.h