Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Implementation of CHECK command for memcached #191

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.
I've been using memcached for storing data with a short lifetime and I found 
that the use of the "add" command to test the existence of a key requires 
additional expenses, because if the key does not exist already (expired) - it 
will be recreated.
I have implemented a new command "check", which allows you to verify the 
existence of a key. This command also allows you to set a new expiration time 
for a key.

Use:   check <key> [exptime] [noreply]

Binary protocol is also supported.

I have attached three patches. Patch for memcached, which implements a new 
command. A patch for the documentation. And a patch for tests.

I also publish my patch through a git:
memcached forked repo: https://github.com/Slader/memcached
and link to commit with patch: 
https://github.com/Slader/memcached/commit/b0f5d95e2704c6d8dc9b63519646d58db2dda
4f2

Original issue reported on code.google.com by romanenko.oleg on 15 Mar 2011 at 4:25

Attachments:

GoogleCodeExporter commented 9 years ago
This seems redundant to the TOUCH command, but in a slightly more confusing way 
in that it seems to have two entirely different meanings.

I'd like to close this as a wontfix since I find it to be semantically 
confusing (the name implies it's RO but it modifies cache contents) and it 
seems to overlap with the existing touch command.

As always, I'm happy to be proven wrong.

Original comment by dsalli...@gmail.com on 18 Jul 2011 at 3:58