A Clojure Memcached client (also: Couchbase, Kestrel). Built on top of SpyMemcached, supports ASCII and binary protocols, strives to be 100% feature complete.
The current implementation of get-and-touch breaks the convention of other operation fns by exposing the returned net.spy.memcached.CASValue directly to the caller.
Example:
user> (mc/get-and-touch c "foo" 300)
#object[net.spy.memcached.CASValue 0x4bd21f9b "{CasValue 2089/bar}"]
Internally, this is the same spymemcached response as gets, except for gets it's transformed to a map with keys #{:cas :value}.
Example:
user> (mc/gets c "foo")
{:value "bar", :cas 2}
Having get-and-touch semantically mimic get and introducing a gets-and-touch that mimics gets would probably be the simplest, but that aside was there a reason for this inconsistency or would a pull request be welcome?
I was thinking of adding a convenience fn async-get-and-touch as well, which is missing.
The current implementation of
get-and-touch
breaks the convention of other operation fns by exposing the returnednet.spy.memcached.CASValue
directly to the caller.Example:
Internally, this is the same spymemcached response as
gets
, except forgets
it's transformed to a map with keys#{:cas :value}
.Example:
Having
get-and-touch
semantically mimicget
and introducing agets-and-touch
that mimicsgets
would probably be the simplest, but that aside was there a reason for this inconsistency or would a pull request be welcome?I was thinking of adding a convenience fn
async-get-and-touch
as well, which is missing.