pymemcache also supports a cas() method, so that's two backends that could
have the other method.

I think the main problem is as Russell highlighted - supporting other
backends. It would be nice to see research into emulating cas(), at least
on LocMemCache which is often used as a fake during testing. Have you got
any input there?

On Tue, 29 Jun 2021 at 18:18, [email protected] <[email protected]>
wrote:

> Currently `PylibMC` includes support for CAS:
> https://sendapatch.se/projects/pylibmc/reference.html#pylibmc.Client.cas
>
> Would a PR be welcome that would implement the `cas` and `gets` methods on
> the `PylibMCCache` cache backend? This would also require setting the `cas`
> behavior to `True` in the `CACHES` setting; I could include documentation
> explaining this in the `PylibMCCache` docs as well.
>
> Thanks so much for maintaining Django. I'd love to help contribute my
> first PR to Django if this would be welcomed!
> On Friday, January 17, 2014 at 9:58:40 PM UTC-5 Curtis Maloney wrote:
>
>> Is it CAS specifically that you want?  Or a Locking primitive?  Or some
>> other operation?
>>
>> --
>> Curtis
>>
>>
>> On 18 January 2014 12:45, Russell Keith-Magee <[email protected]>
>> wrote:
>>
>>>
>>> I can't see any reason that we *shouldn't* support it - it seems like a
>>> reasonable primitive to support.
>>>
>>> The only real issue is ensuring it either is, or can be, implemented on
>>> all backends and supported memcache libraries. If you can produce a patch
>>> that does this, I'd say it has a good chance of being merged into trunk.
>>>
>>> Yours,
>>> Russ Magee %-)
>>>
>>>
>>> On Sat, Jan 18, 2014 at 2:41 AM, Alexey Moskvin <[email protected]>
>>> wrote:
>>>
>>>> Hi all,
>>>> there is a usefull (for me now :)) CAS operation in memcache:
>>>> http://neopythonic.blogspot.ru/2011/08/compare-and-set-in-memcache.html,
>>>> but I can't find it in django cache api.
>>>> Are there any reasons for it not to be implemented there?
>>>> Thank you!
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django developers" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at http://groups.google.com/group/django-developers.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-developers/be66496f-80ee-498a-9e38-f3a6d2c0cbdc%40googlegroups.com
>>>> .
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/django-developers.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/CAJxq84_vqVWQfYJ5tGPS1kGZz_O944yFevd1691h6BWbDJp3_w%40mail.gmail.com
>>> .
>>
>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/580772ed-75b7-4bc5-9f06-3b153d167bebn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/580772ed-75b7-4bc5-9f06-3b153d167bebn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2VLruVYW-FxiBgZTNknf0UDWHXkJ%3Dp7GcbXHQpGGx0oA%40mail.gmail.com.

Reply via email to