From 4ea20eda4dac33624111c1f6e8802a6585fd02e8 Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Mon, 2 Sep 2024 22:02:14 +0200 Subject: [PATCH] dox.yml: fixes --- .github/workflows/dox.yml | 35 +++++++++++++++++++++++++---------- README.md | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dox.yml b/.github/workflows/dox.yml index 1bf9b4c..78ce083 100644 --- a/.github/workflows/dox.yml +++ b/.github/workflows/dox.yml @@ -29,8 +29,9 @@ jobs: - name: Check out RedisX uses: actions/checkout@v4 - with: - path: redisx + with: + repository: Smithsonian/redisx + path: redisx - name: Check out xchange uses: actions/checkout@v4 @@ -46,7 +47,6 @@ jobs: site-update: name: Update github pages - working-directory: ./redisx needs: apidocs if: github.repository_owner == 'Smithsonian' && (github.event_name == 'release' || contains(github.event.head_commit.message, 'site update')) @@ -55,13 +55,29 @@ jobs: - name: Checkout source uses: actions/checkout@v4 + repository: Smithsonian/redisx + path: redisx + + - name: Check out xchange + uses: actions/checkout@v4 + with: + repository: Smithsonian/xchange + path: xchange - name: Generate headless README - run: make README-orig.md + run: make -C redisx README-orig.md + + - name: Generate xchange apidocs + uses: mattnotmitt/doxygen-action@v1.9.8 + with: + additional-packages: font-roboto + working-directory: ./xchange - - uses: mattnotmitt/doxygen-action@v1.9.8 + - name: Generate RedisX apidocs + uses: mattnotmitt/doxygen-action@v1.9.8 with: additional-packages: font-roboto + working-directory: ./redisx - name: Checkout gh-pages uses: actions/checkout@v4 @@ -74,15 +90,15 @@ jobs: - name: Copy README run: | - echo 'CfA logo' > site/doc/README.md + echo 'CfA logo' > site/doc/README.md echo '
' >> site/doc/README.md - cat README-orig.md >> site/doc/README.md + cat redisx/README-orig.md >> site/doc/README.md - name: Copy CHANGELOG - run: cp CHANGELOG.md site/doc/ + run: cp redisx/CHANGELOG.md site/doc/ - name: Copy API documentation - run: cp -a apidoc site/ + run: cp -a redisx/apidoc site/ - name: Push to pages run: | @@ -95,7 +111,6 @@ jobs: changelog-update: name: Update CHANGELOG on github pages - working-directory: ./redisx if: github.repository_owner == 'Smithsonian' && contains(github.event.head_commit.message, 'changelog update') runs-on: ubuntu-latest diff --git a/README.md b/README.md index 1fa6ced..d8b5655 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ A simple, light-weight C/C++ Redis client. ## Table of Contents - [Introduction](#introduction) - - [Pre-requisites](#pre-requisites) - - [Buildding RedisX](#building-redisx) - - [Managing Redis server connetions](#managing-redis-server-connections) + - [Prerequisites](#prerequisites) + - [Building RedisX](#building-redisx) + - [Managing Redis server connections](#managing-redis-server-connections) - [Simple Redis queries](#simple-redis-queries) - [Atomic execution blocks and LUA scripts](#atomic-transaction-blocks-and-lua-scripts) - [Publish/subscribe (PUB/SUB) support](#publish-subscribe-support) @@ -58,8 +58,8 @@ There are no official releases of __RedisX__ yet. An initial 1.0.0 release is ex ----------------------------------------------------------------------------- - -## Pre-requisites + +## Prerequisites The [Smithsonian/xchange](https://github.com/Smithsonian/xchange) library is both a build and a runtime dependency of RedisX. @@ -360,6 +360,7 @@ with the approrpiate mutex locked to prevent concurrency issues. // other requests concurrently... redisxLockEnabled(pipe); + // ------------------------------------------------------------------------- // Submit a whole bunch of asynchronous requests, e.g. from a loop... for (...) { int status = redisxSendRequestAsync(pipe, ...); @@ -374,6 +375,7 @@ with the approrpiate mutex locked to prevent concurrency issues. ... } } + // ------------------------------------------------------------------------- // Release the exclusive lock on the pipeline channel, so // other threads may use it now that we sent off our requests... @@ -693,11 +695,35 @@ subscriber function as appropriate (provided no other subscription needs it) via ## Error handling +Error handling of RedisX is an extension of that of __xchange__, with further error codes defined in `redisx.h`. +The RedisX functions that return an error status (either directly, or into the integer designated by a pointer +argument), can be inspected by `redisxErrorDescription()`, e.g.: + +```c + Redis *redis ... + int status = redisxSetValue(...); + if (status != X_SUCCESS) { + // Ooops, something went wrong... + fprintf(stderr, "WARNING! set value: %s", redisErrorDescription(status)); + ... + } +``` + + ----------------------------------------------------------------------------- ## Debug support +The __xchange__ library provides two macros: `xvprintf()` and `xdprintf()`, for printing verbose and debug messages +to `stderr`. Both work just like `printf()`, but they are conditional on verbosity being enabled via +`xSetVerbose(boolean)` and the global variable `xDebug` being `TRUE` (non-zero), respectively. Applications using +__xchange__ may use these macros to produce their own verbose and/or debugging outputs conditional on the same global +settings. + +You can also turn debug messages by defining the `DEBUG` constant for the compiler, e.g. by adding `-DDEBUG` to +`CFLAGS` prior to calling `make`. + -----------------------------------------------------------------------------