dogpile.cache icon indicating copy to clipboard operation
dogpile.cache copied to clipboard

How can i implement a CAS and GETS use this repo?

Open Milittle opened this issue 4 years ago • 6 comments

How can i implement a CAS and GETS use this repo? Thx

Milittle avatar Jul 31 '21 02:07 Milittle

Hi there -

I haven't googled to see what these acronyms are for, please provide a little bit of human readable detail for what it is you're requesting, thanks

zzzeek avatar Jul 31 '21 12:07 zzzeek

internal google just spit out "compare and swap" as I was staring into space. I usually have seen this for database values. Seems like you might need some creativity to get dogpile to do this as it is oriented around values that are safe to use when stale.

zzzeek avatar Jul 31 '21 12:07 zzzeek

I mean the memcached have cas and gets command to support the "compare and swap". How can i use this repo to call the feature. Thx.

Milittle avatar Aug 01 '21 15:08 Milittle

I don't really know memcached protocol, can you provide an example using one of the memcached client libraries directly ?

zzzeek avatar Aug 01 '21 17:08 zzzeek

https://github.com/linsomniac/python-memcached/blob/bad41222379102e3f18f6f2f7be3ee608de6fbff/memcache.py#L729

Milittle avatar Aug 03 '21 08:08 Milittle

Dogpile doesn't expose that method as it is not part of the general idea of what dogpile provides. As this is a memcached-specific call you are better off calling into the python-memcached library directly.

zzzeek avatar Aug 03 '21 11:08 zzzeek