mcpp index

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

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// 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 · 项目 tests/examples/redis-plus-plus-v133

构建

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

源文件 (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

生成的文件

  • mcpp_generated/sw/redis++/hiredis_features.h

版本

版本平台 镜像sha256
1.3.13 最新 LinuxWindowsmacOS 源站 678a61898ed7…
1.3.3 LinuxWindowsmacOS 源站 23689059b7ba…