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

How do I use connection for multi thread? #180

Closed
uryyyyyyy opened this issue Jan 20, 2016 · 2 comments
Closed

How do I use connection for multi thread? #180

uryyyyyyy opened this issue Jan 20, 2016 · 2 comments
Labels
for: stackoverflow A question that is better suited to stackoverflow.com

Comments

@uryyyyyyy
Copy link

Hi.
I want to use RedisClusterClient with multi thread client with StatefulRedisClusterConnection.
but I cannot found how I should use connection.

in thins issue(https://github.com/mp911de/lettuce/issues/157), mp911de said we no need to use connection pool.

if so, which we should use for multi thread client access?

  • reuse stateful connection
  • every time we create new connection

Thanks!

@mp911de mp911de added the for: stackoverflow A question that is better suited to stackoverflow.com label Jan 20, 2016
@mp911de
Copy link
Collaborator

mp911de commented Jan 20, 2016

Hi @uryyyyyyy,

lettuce is thread-safe, you can reuse stateful connections across multiple threads. The only exception is if you use blocking commands such as BLPOP. When using blocking commands, you should use multiple connection to not block other threads.

お役に立ったなら幸いです, Mark

@uryyyyyyy
Copy link
Author

@mp911de
that's all I want to know!

Thanks!! I will use lettuce for our service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that is better suited to stackoverflow.com
Projects
None yet
Development

No branches or pull requests

2 participants