-
Notifications
You must be signed in to change notification settings - Fork 353
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
Not very clear how connection pool works #80
Comments
@danalex07 Thanks for the suggestion! I'll add more detailed doc for connection pool to README.
You can set the size of the pool with The following is an example of how to create a
Regards |
So that way I can create multiple Redis objects in multiple methods and all will be calling the same pool?
I'm asking this because in my app multiple threads are going to access method_a and method_b in a short period of time, so I'm worried about performance. |
@danalex07 These In fact, you should create a single
It's thread-safe, and you can run both methods in a multi-thread environment. Regards |
@sewenew Really an awesome library with modern c++ support! I appreciate your efforts!
|
@hrishikesh713 Thanks for choosing redis-plus-plus :)
YES
YES, a broken connection will be added to the pool. The next time when the broken connection is fetched from the pool, redis-plus-plus will reconnect it.
NO, there's no such strategies. You have to do it with your own code, e.g. if you get an exception from redis-plus-plus, you can retry the command or give it up. Regards |
Guys, I already updated doc for connection pool. I'll close this issue, if you still have problem on it, feel free to reopen it. Regards |
Hi, I have some questions about the connection pool
|
Regards |
Thanks for replying. |
Hi @sewenew I'm using your client for my project and works like a charm, but I don't see clearly how to use the ConnectionPool option, I mean I'm no expert but I haven't been able to make it work, can u provide a clear example or maybe write it on the wiki? thanks a lot.
The text was updated successfully, but these errors were encountered: