-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding sentinel timeout parameters #42
base: master
Are you sure you want to change the base?
Conversation
so that pkgconfig is in side lib directory
*/ | ||
inline static ptr_t createTimeout(const std::string& host="localhost", | ||
const unsigned int port=6379, | ||
const struct timeval timeout=defaultTimeout()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the rest of the project, I'd like create_timeout
instead of createTimeout
. So underscore syntax. Is it a problem for you?
Also, why not using std::chrono
time intervals instead of struct timeval
? Could it be more C++11 friendly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can change to create_timeout.
I used struct timeval because that what is used by hiredis redisConnectWithTimeout
struct timeval timeout = { 1, 500000 }; // 1.5 seconds c = redisConnectWithTimeout(hostname, port, timeout);
Thanks for your contribution! Looks good, I did some comments inline with the code. |
allows for lower connectivity timeout when connecting to sentinels in redis HA cluster mode.