Support multi-key operations
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).
Got, I'll try to implemented this on weekend.
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?
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?
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.
@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.
See PR #110 :-)