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

add support for ConnWithTimeout #25

Merged
merged 3 commits into from
Jan 27, 2019
Merged

add support for ConnWithTimeout #25

merged 3 commits into from
Jan 27, 2019

Conversation

letsfire
Copy link
Contributor

@letsfire letsfire commented Jan 26, 2019

For #17

@mna
Copy link
Owner

mna commented Jan 26, 2019

Thanks, looks good! I'd like to see a couple tests before merging, one for DoWithTimeout and another for ReceiveWithTimeout. What I have in mind to test this is:

  • Create a cluster with the DialOptions specifying a DialReadTimeout of 1s
  • Call Do with the BLPOP X 2 (i.e. block on popping list X for 2 seconds), this should fail due to the read timeout (1s)
  • Call DoWithTimeout with a timeout of 3s, with the BLPOP X 2 command, this should succeed (and return nil because the list is empty)

Similarly for ReceiveWithTimeout, call Send instead of Do to send the BPOP command, and then Receive should fail due to the read timeout while ReceiveWithTimeout should succeed.

@letsfire
Copy link
Contributor Author

@mna I tested the code as you said. My english is poor, i hope i did the right things

@mna
Copy link
Owner

mna commented Jan 27, 2019

Hey thanks! No worries, you did a great job, I'm just gonna tweak the test a little bit for the Receive part but otherwise everything looks great, I should able to merge today!

@mna mna merged commit feb2228 into mna:master Jan 27, 2019
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