RedisX v0.9
A simple, light-weight Redis database client
|
Functions | |
void * | RedisPipelineListener (void *pRedis) |
int | redisxConnect (Redis *redis, boolean usePipeline) |
void | redisxDestroy (Redis *redis) |
void | redisxDisconnect (Redis *redis) |
Redis * | redisxInit (const char *server) |
boolean | redisxIsConnected (Redis *redis) |
int | redisxReconnect (Redis *redis, boolean usePipeline) |
int | redisxSetPort (Redis *redis, int port) |
void | redisxSetTcpBuf (int size) |
Network layer management functions for the RedisX library.
void * RedisPipelineListener | ( | void * | pRedis | ) |
The listener function that processes pipelined responses in the background. It is started when Redis is connected with the pipeline enabled.
pRedis | Pointer to a Redis instance. |
References FALSE, RESP::n, Redis::pipeline, redisxDestroyRESP(), redisxReadReplyAsync(), RESP_SIMPLE_STRING, RESP::type, x_error(), and xvprintf.
Connects to a Redis server.
redis | Pointer to a Redis instance. |
usePipeline | TRUE (non-zero) if Redis should be connected with a pipeline client also, or FALSE (0) if only the interactive client is needed. |
void redisxDestroy | ( | Redis * | redis | ) |
Destroys a Redis intance, disconnecting any clients that may be connected, and freeing all resources used by that Redis instance.
redis | Pointer to a Redis instance. |
References REDISX_CHANNELS, redisxDisconnect(), and redisxIsConnected().
void redisxDisconnect | ( | Redis * | redis | ) |
Redis * redisxInit | ( | const char * | server | ) |
Initializes the Redis client library, and sets the hostname or IP address for the Redis server.
server | Server host name or numeric IP address, e.g. "127.0.0.1" |
References FALSE, Redis::id, Redis::interactive, Redis::pipeline, REDISX_CHANNELS, REDISX_INTERACTIVE_CHANNEL, REDISX_PIPELINE_CHANNEL, REDISX_SUBSCRIPTION_CHANNEL, REDISX_TCP_PORT, Redis::subscription, TRUE, x_error(), x_trace_null(), and xStringCopyOf().
Checks if a Redis instance is connected.
redis | Pointer to a Redis instance. |
References FALSE, and Redis::interactive.
Disconnects from Redis, and then connects again...
redis | Pointer to a Redis instance. |
usePipeline | Whether to reconnect in pipelined mode. |
or else an error (<0) as would be returned by redisxConnect().
int redisxSetPort | ( | Redis * | redis, |
int | port | ||
) |
Sets a non-standard TCP port number to use for the Redis server, prior to calling redisxConnect()
.
redis | Pointer to a Redis instance. |
port | The TCP port number to use. |
void redisxSetTcpBuf | ( | int | size | ) |
Set the size of the TCP/IP buffers (send and receive) for future client connections.
size | (bytes) requested buffer size, or <= 0 to use default value |
References xvprintf.