-
Notifications
You must be signed in to change notification settings - Fork 43
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
Set CQL3 consistency per connection #64
base: master
Are you sure you want to change the base?
Conversation
@ottbot Finally sending this upstream... sorry to let it lie fallow! |
Can we mutex the with_consistency call so that this becomes thread safe again? |
My initial assumption was that connections would not be shared between threads, but realistically one would probably be using some sort of connection pooling which makes this particular approach pretty bad. How about as an alternative, If this seems reasonable I'd be glad to code it up and update this PR. |
I think that makes a lot more sense. Its a breaking change but we can just bump the minor version and if you could slightly alter the README to let people know about the new API, that'd be fantastic. |
Great! Although I don't think it has to be a breaking change if we just check the type of the second argument? |
I suppose, but I prefer to minimize the overhead per query as much as possible and adding hash munging to it already makes me unhappy, though thats just how ruby rolls. We could write multiple methods and have RUBY_VERSION >= 2 use named keywords :) |
OK, no strong objection here if you're down for a breaking change – do you think it's worth providing an alternate implementation for Ruby 2? |
I know that hash setup/teardown is pretty gross for GC/CPU in ruby, but I've not specifically benchmarked the difference between using keyword arguments and a hash ... I don't know what ruby does under the hood for that. For now don't bother, maybe just add a TODO note or something. |
Will do! |
Not thread-safe as the assumption is you'll use one connection per thread.
Adapted from outoftime#3