RedisX v0.9
A simple, light-weight Redis database client
|
Functions | |
Redis * | redisxInitSentinel (const char *serviceName, const RedisServer *serverList, int nServers) |
int | redisxSetSentinelTimeout (Redis *redis, int millis) |
int | redisxValidateSentinel (const char *serviceName, const RedisServer *serverList, int nServers) |
Functions to manage clients to high-availability Redis Sentinel server configurations.
Redis * redisxInitSentinel | ( | const char * | serviceName, |
const RedisServer * | serverList, | ||
int | nServers | ||
) |
Initializes a Redis client with a Sentinel configuration of alternate servers, and the default sentinel node connection timeout.
serviceName | The service name as registered in the Sentinel server configuration. The supplied name will be copied, not referenced, so that the value passed may be freely destroyed after the call. |
serverList | An set of Sentinel servers to use to dynamically find the current master. The list itself and its contents are not referenced. Instead a deep copy will be made of it, so the list that was pased can be freely destroyed after the call. |
nServers | The number of servers in the list |
References REDISX_DEFAULT_SENTINEL_TIMEOUT_MILLIS, redisxInit(), redisxValidateSentinel(), x_error(), X_SUCCESS, x_trace_null(), and xStringCopyOf().
int redisxSetSentinelTimeout | ( | Redis * | redis, |
int | millis | ||
) |
Changes the connection timeout for Sentinel server instances in the discovery phase. This is different from the timeout that is used for the master server, once it is discovered.
redis | The Redis instance, which was initialized for Sentinel via redisxInitSentinel(). |
millis | [ms] The new connection timeout or <=0 to use the default value. |
References REDISX_DEFAULT_SENTINEL_TIMEOUT_MILLIS, x_error(), X_NO_INIT, and X_SUCCESS.
int redisxValidateSentinel | ( | const char * | serviceName, |
const RedisServer * | serverList, | ||
int | nServers | ||
) |
Validates a Sentinel configuration.
serviceName | The service name as registered in the Sentinel server configuration. |
serverList | An set of Sentinel servers to use to dynamically find the current master. |
nServers | The number of servers in the list |
References x_error(), X_GROUP_INVALID, X_NAME_INVALID, X_NULL, X_SIZE_INVALID, and X_SUCCESS.