summaryrefslogtreecommitdiff
path: root/hiredis.h
diff options
context:
space:
mode:
authorvalentinogeron <valentino@redislabs.com>2020-07-26 22:32:27 +0300
committerGitHub <noreply@github.com>2020-07-26 12:32:27 -0700
commit38b5ae543f5c99eb4ccabbe277770fc6bc81226f (patch)
tree9377e746a4fce5ab34730f16c06c11db3bbfb839 /hiredis.h
parent3bb985314d0563857c84beef0097ffc8de2d9438 (diff)
add a command_timeout to redisContextOptions (#839)
Add an additional timeout so the user has a convenient way of controlling distinct connect and command timeouts
Diffstat (limited to 'hiredis.h')
-rw-r--r--hiredis.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/hiredis.h b/hiredis.h
index 20e9bfa..fe2dae4 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -176,8 +176,10 @@ typedef struct {
int type;
/* bit field of REDIS_OPT_xxx */
int options;
- /* timeout value. if NULL, no timeout is used */
- const struct timeval *timeout;
+ /* timeout value for connect operation. if NULL, no timeout is used */
+ const struct timeval *connect_timeout;
+ /* timeout value for commands. if NULL, no timeout is used. (can be set later on with redisSetTimeout/redisAsyncSetTimeout) */
+ const struct timeval *command_timeout;
union {
/** use this field for tcp/ip connections */
struct {
@@ -230,7 +232,8 @@ typedef struct redisContext {
redisReader *reader; /* Protocol reader */
enum redisConnectionType connection_type;
- struct timeval *timeout;
+ struct timeval *connect_timeout;
+ struct timeval *command_timeout;
struct {
char *host;