Skip to content

Conversation

@ibensw
Copy link

@ibensw ibensw commented Mar 31, 2025

Since redis 6.0.0, blocking list commands accept doubles as timeouts instead of integers.

This pull request updates the following parameters for the commands blpop, brpop, brpoplpush and blmove:

  • long long timeout to double timeout
  • std::chrono::seconds to std::chrono::duration<double>

@sewenew
Copy link
Owner

sewenew commented Apr 2, 2025

Thanks for the contribution!

However, this PR has 2 problems:

  • The test code fails to build, it seems that it's not compatible with existent code
  • The change cannot work with Redis server older than 6.0

Looks like that we need to add an overloads instead of changing the type of timeout parameter from std::chrono::seconds to std::chrono::duration<double>.

Regards

@ibensw
Copy link
Author

ibensw commented Apr 3, 2025

Thank you for your feedback.
Running the tests on redis server 7.0.15 does not yield any failures. What failures did you observe?
Your comment for older redis versions stands. I will change add the overloads instead of changing them.

@sewenew
Copy link
Owner

sewenew commented Apr 5, 2025

My bad! Looks like my building env is problematic, and it failed to build the test code. I cleaned the building env, and rebuild the code, it can build successfully, although the test fails with redis 4.0.

Regards

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