Skip to content

adding sentinel timeout parameters#42

Open
hurdad wants to merge 10 commits into
luca3m:masterfrom
hurdad:master
Open

adding sentinel timeout parameters#42
hurdad wants to merge 10 commits into
luca3m:masterfrom
hurdad:master

Conversation

@hurdad

@hurdad hurdad commented Apr 4, 2016

Copy link
Copy Markdown

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

* @return
*/
inline static ptr_t createTimeout(const std::string& host="localhost",
const unsigned int port=6379,

Copy link
Copy Markdown
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
Copy Markdown
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

luca3m commented Apr 5, 2016

Copy link
Copy Markdown
Owner

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