diff --git a/apidoc/html/index.html b/apidoc/html/index.html index fb34bb2..05d598c 100644 --- a/apidoc/html/index.html +++ b/apidoc/html/index.html @@ -183,10 +183,10 @@

// Free up the resources used by the 'redis' instance.
redisxDestroy(redis);
-
Redis * redisxInit(const char *server)
Definition redisx-net.c:794
-
void redisxDestroy(Redis *redis)
Definition redisx-net.c:975
+
Redis * redisxInit(const char *server)
Definition redisx-net.c:797
+
void redisxDestroy(Redis *redis)
Definition redisx-net.c:977
void redisxDisconnect(Redis *redis)
Definition redisx-net.c:512
-
int redisxConnect(Redis *redis, boolean usePipeline)
Definition redisx-net.c:1108
+
int redisxConnect(Redis *redis, boolean usePipeline)
Definition redisx-net.c:1110
RESP * redisxRequest(Redis *redis, const char *command, const char *arg1, const char *arg2, const char *arg3, int *status)
Definition redisx.c:586
@ RESP_BULK_STRING
RESP bulk string type.
Definition redisx.h:107
@@ -208,7 +208,7 @@

Features overview

-Generic API Features

+General Features @@ -350,7 +350,7 @@

// (optional) configure a non-standard port number to use
redisxSetPort(redis, 7089);
-
int redisxSetPort(Redis *redis, int port)
Definition redisx-net.c:1050
+
int redisxSetPort(Redis *redis, int port)
Definition redisx-net.c:1052

Sentinel

Alternatively, instead of redisxInit() above you may initialize the client for a high-availability configuration using with a set of Redis Sentinel servers, using redisxInitSentinel(), e.g.:

@@ -367,8 +367,8 @@

// (optional) set a sentinel discovery timeout in ms...
redisxSetSentinelTimeout(redis, 30);
-
int redisxSetSentinelTimeout(Redis *redis, int millis)
Definition redisx-net.c:943
-
Redis * redisxInitSentinel(const char *serviceName, const RedisServer *serverList, int nServers)
Definition redisx-net.c:897
+
int redisxSetSentinelTimeout(Redis *redis, int millis)
Definition redisx-net.c:945
+
Redis * redisxInitSentinel(const char *serviceName, const RedisServer *serverList, int nServers)
Definition redisx-net.c:899
Definition redisx.h:208

After successful initialization, you may proceed with the configuration the same way as for the regular standalone server connection.

One thing to keep in mind about Sentinel is that once the connection to the master is established, it works just like a regular server connection, including the possibility of that connection being broken. It is up to the application to initiate reconnection and recovery as appropriate in case of errors. (See more in on Reconnecting further below).

@@ -404,8 +404,8 @@

// (optional) Set the TCP send/rcv buffer sizes to use if not default values.
redisxSetTcpBuf(redis, 65536);
-
int redisxSetTcpBuf(Redis *redis, int size)
Definition redisx-net.c:1026
-
int redisxSetSocketTimeout(Redis *redis, int millis)
Definition redisx-net.c:1076
+
int redisxSetTcpBuf(Redis *redis, int size)
Definition redisx-net.c:1028
+
int redisxSetSocketTimeout(Redis *redis, int millis)
Definition redisx-net.c:1078

If you want, you can perform further customization of the client sockets via a user-defined callback function, e.g.:

int my_socket_config(int sock, enum redisx_channel channel) {
// Set up the socket any way you like...
@@ -502,13 +502,13 @@

...

The redisxRequest() sends a command with up to three arguments. If the command takes fewer than 3 parameters, then the remaining ones must be set to NULL. This function thus offers a simple interface for running most basic sequential queries. In cases where 3 parameters are not sufficient, you may use redisxArrayRequest() instead, e.g.:

...
-
char *args[] = { "my_table", "my_key" }; // parameters as an array...
+
char *args[] = { "HGET", "my_table", "my_key" }; // parameters as an array...
-
// Send "HGET my_table my_key" request with an array of 2 parameters...
-
resp = redisxArrayRequest(redis, "HGET", args, NULL, 2, &status);
+
// Send "HGET my_table my_key" request with an array of 3 components...
+
resp = redisxArrayRequest(redis, args, NULL, 3, &status);
...
RESP * redisxArrayRequest(Redis *redis, const char **args, const int *lengths, int n, int *status)
Definition redisx.c:641
-

The 4th argument in the list is an optional int[] array defining the individual string lengths of the parameters (if need be, or else readily available). Here, we used NULL instead, which will use strlen() on each supplied string-terminated parameter to determine its length automatically. Specifying the length may be necessary if the individual parameters are not 0-terminated strings.

+

The 3rd argument in the list is an optional int[] array defining the individual string lengths of the parameters (if need be, or else readily available). Here, we used NULL instead, which will use strlen() on each supplied string-terminated parameter to determine its length automatically. Specifying the length may be necessary if the individual parameters are not 0-terminated strings.

In interactive mode, each request is sent to the Redis server, and the response is collected before the call returns with that response (or NULL if there was an error).

diff --git a/apidoc/html/navtreedata.js b/apidoc/html/navtreedata.js index 5c3829c..4caed17 100644 --- a/apidoc/html/navtreedata.js +++ b/apidoc/html/navtreedata.js @@ -30,7 +30,7 @@ var NAVTREE = [ "Introduction", "index.html#autotoc_md4", [ [ "A simple example", "index.html#autotoc_md5", null ], [ "Features overview", "index.html#autotoc_md6", [ - [ "Generic API Features", "index.html#autotoc_md7", null ], + [ "General Features", "index.html#autotoc_md7", null ], [ "Redis / Valkey Features", "index.html#autotoc_md8", null ] ] ], [ "Related links", "index.html#autotoc_md9", null ] diff --git a/apidoc/html/redisx-net_8c.html b/apidoc/html/redisx-net_8c.html index d8edde8..27a4c0b 100644 --- a/apidoc/html/redisx-net_8c.html +++ b/apidoc/html/redisx-net_8c.html @@ -338,7 +338,7 @@

Returns
X_SUCCESS or X_FAILURE if the IP address is invalid. X_NULL if the IP address is NULL.
See also
redisxInitSentinel()
-

References FALSE, Redis::interactive, Redis::pipeline, REDISX_CHANNELS, REDISX_DEFAULT_TIMEOUT_MILLIS, REDISX_INTERACTIVE_CHANNEL, REDISX_PIPELINE_CHANNEL, REDISX_RESP2, REDISX_SUBSCRIPTION_CHANNEL, REDISX_TCP_BUF_SIZE, Redis::subscription, TRUE, x_error(), and x_trace_null().

+

References FALSE, Redis::interactive, Redis::pipeline, REDISX_CHANNELS, REDISX_DEFAULT_TIMEOUT_MILLIS, REDISX_INTERACTIVE_CHANNEL, REDISX_PIPELINE_CHANNEL, REDISX_RESP2, REDISX_SUBSCRIPTION_CHANNEL, REDISX_TCP_BUF_SIZE, Redis::subscription, TRUE, x_error(), X_SUCCESS, and x_trace_null().

diff --git a/apidoc/html/redisx_8h.html b/apidoc/html/redisx_8h.html index 9baa3bc..2a07f52 100644 --- a/apidoc/html/redisx_8h.html +++ b/apidoc/html/redisx_8h.html @@ -2385,7 +2385,7 @@

Returns
X_SUCCESS or X_FAILURE if the IP address is invalid. X_NULL if the IP address is NULL.
See also
redisxInitSentinel()
-

References FALSE, Redis::interactive, Redis::pipeline, REDISX_CHANNELS, REDISX_DEFAULT_TIMEOUT_MILLIS, REDISX_INTERACTIVE_CHANNEL, REDISX_PIPELINE_CHANNEL, REDISX_RESP2, REDISX_SUBSCRIPTION_CHANNEL, REDISX_TCP_BUF_SIZE, Redis::subscription, TRUE, x_error(), and x_trace_null().

+

References FALSE, Redis::interactive, Redis::pipeline, REDISX_CHANNELS, REDISX_DEFAULT_TIMEOUT_MILLIS, REDISX_INTERACTIVE_CHANNEL, REDISX_PIPELINE_CHANNEL, REDISX_RESP2, REDISX_SUBSCRIPTION_CHANNEL, REDISX_TCP_BUF_SIZE, Redis::subscription, TRUE, x_error(), X_SUCCESS, and x_trace_null().

diff --git a/apidoc/html/search/all_1.js b/apidoc/html/search/all_1.js index 8abb309..414ee0c 100644 --- a/apidoc/html/search/all_1.js +++ b/apidoc/html/search/all_1.js @@ -10,9 +10,8 @@ var searchData= ['and_20pipelining_7',['Advanced queries and pipelining',['../index.html#autotoc_md48',1,'']]], ['and_20scanning_8',['Listing and Scanning',['../index.html#autotoc_md37',1,'']]], ['and_20setting_20keyed_20values_9',['Getting and setting keyed values',['../index.html#autotoc_md36',1,'']]], - ['api_20features_10',['Generic API Features',['../index.html#autotoc_md7',1,'']]], - ['application_20against_20redisx_11',['Linking your application against RedisX',['../index.html#autotoc_md17',1,'']]], - ['asynchronous_20client_20processing_12',['Asynchronous client processing',['../index.html#autotoc_md49',1,'']]], - ['atomic_20execution_20blocks_20and_20lua_20scripts_13',['Atomic execution blocks and LUA scripts',['../index.html#autotoc_md43',1,'']]], - ['attributes_14',['attributes',['../index.html#autotoc_md31',1,'Bundled Attributes'],['../index.html#autotoc_md50',1,'Bundled Attributes']]] + ['application_20against_20redisx_10',['Linking your application against RedisX',['../index.html#autotoc_md17',1,'']]], + ['asynchronous_20client_20processing_11',['Asynchronous client processing',['../index.html#autotoc_md49',1,'']]], + ['atomic_20execution_20blocks_20and_20lua_20scripts_12',['Atomic execution blocks and LUA scripts',['../index.html#autotoc_md43',1,'']]], + ['attributes_13',['attributes',['../index.html#autotoc_md31',1,'Bundled Attributes'],['../index.html#autotoc_md50',1,'Bundled Attributes']]] ]; diff --git a/apidoc/html/search/all_6.js b/apidoc/html/search/all_6.js index 2e71ddb..5d777fb 100644 --- a/apidoc/html/search/all_6.js +++ b/apidoc/html/search/all_6.js @@ -1,6 +1,6 @@ var searchData= [ - ['features_0',['features',['../index.html#autotoc_md7',1,'Generic API Features'],['../index.html#autotoc_md8',1,'Redis / Valkey Features']]], + ['features_0',['features',['../index.html#autotoc_md7',1,'General Features'],['../index.html#autotoc_md8',1,'Redis / Valkey Features']]], ['features_20overview_1',['Features overview',['../index.html#autotoc_md6',1,'']]], ['firstfield_2',['firstField',['../../../xchange/apidoc/html/structXStructure.html#a501ae8af2201d9cfaa60e3af21ff58fc',1,'XStructure']]], ['functions_3',['Custom Redis functions',['../index.html#autotoc_md46',1,'']]], diff --git a/apidoc/html/search/all_7.js b/apidoc/html/search/all_7.js index 549f7c9..ba7138a 100644 --- a/apidoc/html/search/all_7.js +++ b/apidoc/html/search/all_7.js @@ -1,5 +1,5 @@ var searchData= [ - ['generic_20api_20features_0',['Generic API Features',['../index.html#autotoc_md7',1,'']]], + ['general_20features_0',['General Features',['../index.html#autotoc_md7',1,'']]], ['getting_20and_20setting_20keyed_20values_1',['Getting and setting keyed values',['../index.html#autotoc_md36',1,'']]] ]; diff --git a/apidoc/html/toc.xml b/apidoc/html/toc.xml index f02a9cf..5f85450 100644 --- a/apidoc/html/toc.xml +++ b/apidoc/html/toc.xml @@ -3,7 +3,7 @@ - + diff --git a/apidoc/man/man3/redisx-net.c.3 b/apidoc/man/man3/redisx-net.c.3 index ff212ab..11b1832 100644 --- a/apidoc/man/man3/redisx-net.c.3 +++ b/apidoc/man/man3/redisx-net.c.3 @@ -171,7 +171,7 @@ X_SUCCESS or X_FAILURE if the IP address is invalid\&. X_NULL if the IP address .PP .PP -References \fBFALSE\fP, \fBRedis::interactive\fP, \fBRedis::pipeline\fP, \fBREDISX_CHANNELS\fP, \fBREDISX_DEFAULT_TIMEOUT_MILLIS\fP, \fBREDISX_INTERACTIVE_CHANNEL\fP, \fBREDISX_PIPELINE_CHANNEL\fP, \fBREDISX_RESP2\fP, \fBREDISX_SUBSCRIPTION_CHANNEL\fP, \fBREDISX_TCP_BUF_SIZE\fP, \fBRedis::subscription\fP, \fBTRUE\fP, \fBx_error()\fP, and \fBx_trace_null()\fP\&. +References \fBFALSE\fP, \fBRedis::interactive\fP, \fBRedis::pipeline\fP, \fBREDISX_CHANNELS\fP, \fBREDISX_DEFAULT_TIMEOUT_MILLIS\fP, \fBREDISX_INTERACTIVE_CHANNEL\fP, \fBREDISX_PIPELINE_CHANNEL\fP, \fBREDISX_RESP2\fP, \fBREDISX_SUBSCRIPTION_CHANNEL\fP, \fBREDISX_TCP_BUF_SIZE\fP, \fBRedis::subscription\fP, \fBTRUE\fP, \fBx_error()\fP, \fBX_SUCCESS\fP, and \fBx_trace_null()\fP\&. .SS "\fBRedis\fP * redisxInitSentinel (const char * serviceName, const \fBRedisServer\fP * serverList, int nServers)" Initializes a \fBRedis\fP client with a Sentinel configuration of alternate servers, and the default sentinel node connection timeout\&. .PP diff --git a/apidoc/man/man3/redisx.h.3 b/apidoc/man/man3/redisx.h.3 index 6e06013..989af04 100644 --- a/apidoc/man/man3/redisx.h.3 +++ b/apidoc/man/man3/redisx.h.3 @@ -1625,7 +1625,7 @@ X_SUCCESS or X_FAILURE if the IP address is invalid\&. X_NULL if the IP address .PP .PP -References \fBFALSE\fP, \fBRedis::interactive\fP, \fBRedis::pipeline\fP, \fBREDISX_CHANNELS\fP, \fBREDISX_DEFAULT_TIMEOUT_MILLIS\fP, \fBREDISX_INTERACTIVE_CHANNEL\fP, \fBREDISX_PIPELINE_CHANNEL\fP, \fBREDISX_RESP2\fP, \fBREDISX_SUBSCRIPTION_CHANNEL\fP, \fBREDISX_TCP_BUF_SIZE\fP, \fBRedis::subscription\fP, \fBTRUE\fP, \fBx_error()\fP, and \fBx_trace_null()\fP\&. +References \fBFALSE\fP, \fBRedis::interactive\fP, \fBRedis::pipeline\fP, \fBREDISX_CHANNELS\fP, \fBREDISX_DEFAULT_TIMEOUT_MILLIS\fP, \fBREDISX_INTERACTIVE_CHANNEL\fP, \fBREDISX_PIPELINE_CHANNEL\fP, \fBREDISX_RESP2\fP, \fBREDISX_SUBSCRIPTION_CHANNEL\fP, \fBREDISX_TCP_BUF_SIZE\fP, \fBRedis::subscription\fP, \fBTRUE\fP, \fBx_error()\fP, \fBX_SUCCESS\fP, and \fBx_trace_null()\fP\&. .SS "\fBRedis\fP * redisxInitSentinel (const char * serviceName, const \fBRedisServer\fP * serverList, int nServers)" Initializes a \fBRedis\fP client with a Sentinel configuration of alternate servers, and the default sentinel node connection timeout\&. .PP diff --git a/doc/README.md b/doc/README.md index 5dfe99f..c19aeb1 100644 --- a/doc/README.md +++ b/doc/README.md @@ -107,7 +107,7 @@ And at every step, you should check for and [handle errors](#error-handling) as ### Features overview -#### Generic API Features +#### General Features | Feature | supported | comments | | --------------------------------- |:----------:| -------------------------------------------------------------| @@ -532,15 +532,15 @@ sequential queries. In cases where 3 parameters are not sufficient, you may use ```c ... - char *args[] = { "my_table", "my_key" }; // parameters as an array... + char *args[] = { "HGET", "my_table", "my_key" }; // parameters as an array... - // Send "HGET my_table my_key" request with an array of 2 parameters... - resp = redisxArrayRequest(redis, "HGET", args, NULL, 2, &status); + // Send "HGET my_table my_key" request with an array of 3 components... + resp = redisxArrayRequest(redis, args, NULL, 3, &status); ... ``` -The 4th argument in the list is an optional `int[]` array defining the individual string lengths of the parameters (if +The 3rd argument in the list is an optional `int[]` array defining the individual string lengths of the parameters (if need be, or else readily available). Here, we used `NULL` instead, which will use `strlen()` on each supplied string-terminated parameter to determine its length automatically. Specifying the length may be necessary if the individual parameters are not 0-terminated strings.

Feature supported comments