Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

hurdad
Copy link

@hurdad hurdad commented Apr 4, 2016

allows for lower connectivity timeout when connecting to sentinels in redis HA cluster mode.

*/
inline static ptr_t createTimeout(const std::string& host="localhost",
const unsigned int port=6379,
const struct timeval timeout=defaultTimeout())
Copy link
Owner

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?

Copy link
Author

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);

@luca3m
Copy link
Owner

luca3m commented Apr 5, 2016

Thanks for your contribution! Looks good, I did some comments inline with the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants