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

Support multi-key operations #49

Open
jonhoo opened this issue Mar 6, 2019 · 6 comments
Open

Support multi-key operations #49

jonhoo opened this issue Mar 6, 2019 · 6 comments

Comments

@jonhoo
Copy link

jonhoo commented Mar 6, 2019

In memcached you can pipeline sending multiple operations to use the network more efficiently. We already have Client::gets, but set, delete, and increment can also be pipelined this way. For high-performance applications, doing this kind of request batching is essential, so it'd be awesome to see support for these added to this crate! The old memcached-rs crate had support for this in the MultiOperation trait, and the implementation is pretty straightforward (and similar to gets).

@aisk
Copy link
Owner

aisk commented Mar 7, 2019

Got, I'll try to implemented this on weekend.

@aisk
Copy link
Owner

aisk commented Mar 7, 2019

I have a question, looks like the ascii protocol does not support multiple operations like sets, and since this crate support both ascii and binary protocol, should we just return an error, or just doing multiple requests to emulate the multiple actions if current client is using ascii protocol?

@aisk aisk added the question label Mar 7, 2019
@jonhoo
Copy link
Author

jonhoo commented Mar 7, 2019

Hmm, I thought the text protocol also supported pipelining requests just fine? Specifically, you can send off multiple requests in rapid succession, and then only wait for them after they've all been sent, no?

@dormando
Copy link

Pipelining works with ASCII with some caveats; if there's an error in the protocol (bad key/something) you end up with a protocol desync and the rest of the commands sent in the pipeline could error. This is worse with if the 'noreply' option is used since that suppresses most errors.

It does work differently than 'get', which has a specific mechanism for pipelining: get key key key key.

@aisk
Copy link
Owner

aisk commented Jul 13, 2019

@dormando I think I was trying to implement deletes function and find the ascii protocol can not support it well. I think I'll try to simulate it using multi operations if people trying using multi key operation under ascii protocol as fallback.

@hathawsh
Copy link

hathawsh commented Feb 9, 2020

See PR #110 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants