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

Way to give timeout values to requests #535

Open
kamaljoshi opened this issue Jun 12, 2015 · 0 comments
Open

Way to give timeout values to requests #535

kamaljoshi opened this issue Jun 12, 2015 · 0 comments

Comments

@kamaljoshi
Copy link

Right now from the documentation and code it seems the only way to give a timeout value to a request is during initialization through the option hash. But If I want different timelimits for different kind of queries there doesn't seem to be a way to do that. This is useful in some scenarios where for some query you want the response very fast so you will give it a lower timelimit compared to a query for which you are happy to wait for a longer time.

I looked through the code. The client class has a with_socket_timeout method which can do this. So, a trivial solution would be to add a method in redis class which accepts timeout limit, method name and arguments and uses the with_socket_timeout method to modify the connection timelimit. I will be happy to give a PR if you guys think this would be a good addition.

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

No branches or pull requests

1 participant