diff options
| author | valentinogeron <valentino@redislabs.com> | 2020-07-26 22:32:27 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-26 12:32:27 -0700 | 
| commit | 38b5ae543f5c99eb4ccabbe277770fc6bc81226f (patch) | |
| tree | 9377e746a4fce5ab34730f16c06c11db3bbfb839 /hiredis.h | |
| parent | 3bb985314d0563857c84beef0097ffc8de2d9438 (diff) | |
| download | hiredict-38b5ae543f5c99eb4ccabbe277770fc6bc81226f.tar.xz | |
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.h | 9 | 
1 files changed, 6 insertions, 3 deletions
| @@ -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; | 
