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

Get sends gets to server and there's no Gets #112

Closed
lovelock opened this issue Dec 20, 2019 · 2 comments
Closed

Get sends gets to server and there's no Gets #112

lovelock opened this issue Dec 20, 2019 · 2 comments

Comments

@lovelock
Copy link

When I call mc.Get("foo"), I mean get foo command, in fact the command sent to server is gets foo like this
image

I mean some servers partially implemented memcache protocol, eg, a message queue service only implemented get and set command, and when gets is called the server would take it as an illegal command.

I would assume that this guy was in the same situation with me #110.

The reason why I make the PR #111 is that I think mc.Get should send get foo instead of gets foo and If one need CAS feature he should call mc.Gets explicitlly.

Anyway thanks for your great work.

@bradfitz
Copy link
Owner

So you want to support a non-memcached server that speaks a subset of the memcached API.

That's pretty low priority for me personally, but if we do it we should probably be able to do it with no API changes.

I bet we can just detect that a gets fails and fall back to plain get and remember that for subsequent calls.

Or, if we must, we could add a Client.DisableCAS bool field that, when true, prefers get over gets.

But we don't want to add parallel Get and Gets methods. Those are terrible names to expose to end users and they're super confusing. (And it's a breaking API change)

@lovelock
Copy link
Author

Great solution.
Actually at first I introduced a property ServerType and did the same thing as you say. However the essential difference is CAS instead of ServerType.

I will do the work and let's check it again. Thanks.

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

2 participants