Re: CAS in cache framework

2021-06-29 Thread ipcam...@gmail.com
Thanks Adam! That makes sense to me - I believe Redis transactions are atomic by default so the `cas` method wouldn't apply there. I took a look at the LocMemCache code, and I think that the need for cas in this instance also doesn't exist - because the code uses a threading Lock() to prevent r

Re: CAS in cache framework

2021-06-29 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
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 test

Re: Cache framework

2020-08-18 Thread Carlton Gibson
Here’s the blog post: https://www.djangoproject.com/weblog/2020/jul/28/community-survey-2020/ It includes links to charts and raw results. > On 19 Aug 2020, at 08:24, Jure Erznožnik wrote: > > May I ask where that sur

Re: Cache framework

2020-08-18 Thread Jure Erznožnik
May I ask where that survey was conducted? I totally missed it. LP, Jure On 18/08/2020 15:33, Carlton Gibson wrote: I think we SHOULD bring a redis cache backend into core. The recent survey showed 70% of our users using redis for caching, with 20%+ using memcached. Nick is working on https:

Re: Cache framework

2020-08-18 Thread Carlton Gibson
> On 19 Aug 2020, at 00:11, René Fleschenberg wrote: > > Or would the built-in cache backend > just not expose those APIs? That one. All I’m proposing is a backend with the current API. Over time that API has grown slightly, so maybe there’d be a case for additional methods, but that woul

Re: Cache framework

2020-08-18 Thread René Fleschenberg
Hi, On 8/18/20 3:33 PM, Carlton Gibson wrote: > I think we SHOULD bring a redis cache backend into core. Would this also mean supporting Redis-specific APIs? I'm thinking of listing keys in particular. Would Django then throw an exception on backends that don't support this? Or would the built-in

Re: Cache framework

2020-08-18 Thread Adam Johnson
> > The recent survey showed 70% of our users using redis for caching, with > 20%+ using memcached. Oh I see you brought data to an opinion fight :) Okay if those are even within 20% of the truth, it completely makes sense to add Redis support! +1 On Tue, 18 Aug 2020 at 14:54, Tobias McNulty w

Re: Cache framework

2020-08-18 Thread Tobias McNulty
On Tue, Aug 18, 2020 at 9:34 AM Carlton Gibson wrote: > I think we SHOULD bring a redis cache backend into core. > > The recent survey showed 70% of our users using redis for caching, with > 20%+ using memcached. > > Nick is working on > https://github.com/django/django/pull/13310 now. > > This’l

Re: Cache framework

2020-08-18 Thread Carlton Gibson
I think we SHOULD bring a redis cache backend into core. The recent survey showed 70% of our users using redis for caching, with 20%+ using memcached. Nick is working on https://github.com/django/django/pull/13310 now. This’ll give us three memcached backends and zero for redis. That doesn

Pickling - Re: Cache framework

2020-08-17 Thread Roger Gammans
On Mon, 2020-08-17 at 10:30 +0200, Jure Erznožnik wrote: > While at it, I have seen that various backends now implement > their own pickling. With the exception of memcached, they > all > implement the same thing. Perhaps it would be beneficial to > move pickling funct

Re: Cache framework

2020-08-17 Thread Carlton Gibson
> On 17 Aug 2020, at 11:32, Adam Johnson wrote: > > Channels can use other layers backends - I'm not sure of existing > alternatives, but they could use e.g. Postgres' NOTIFY, Google PubSub, AWS > SNS, etc. The only other active channel layer backend that I’m aware of is for RabbitMQ: https

Re: Cache framework

2020-08-17 Thread Adam Johnson
Hi Jure The caching framework exists mostly to provide a memcached-like API. Memcached does not support either of your two first options - there's no efficient way to list keys, nor does it make any atomicity guarantees (outside of a single key). I think for most applications you'll find it easier

Cache framework

2020-08-17 Thread Jure Erznožnik
Apologies for wall of text, but it's a complex issue I'm raising. Hopefully you will see something you thought about in the recent past. I have also indented the rationalisation part, so if it's TL;DR, don't read it. Well, on with it: I've lately had some dealings with Django caching framework

Re: CAS in cache framework

2014-01-17 Thread Curtis Maloney
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 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 ensur

Re: CAS in cache framework

2014-01-17 Thread Russell Keith-Magee
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

CAS in cache framework

2014-01-17 Thread Alexey Moskvin
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 a

Re: Signals sent by the cache framework?

2009-04-01 Thread Ludvig Ericson
On Mar 30, 2009, at 10:55, Oliver Beattie wrote: > In any case, the solution I have at the moment (replacing the cache > backend with a proxy to it at test runtime which tracks the activity) > works okay. It was just a thought about the signals, but I can > absolutely see why you don't want to imp

Re: Signals sent by the cache framework?

2009-03-30 Thread Oliver Beattie
> There should be no monkey-patching involved. Using a separate settings > file for tests so that it points to its own cache isn't monkey patching > -- it's normal practice. Tests don't run in production environments, so > some settings have to be changed. I do have separate settings for all the

Re: Signals sent by the cache framework?

2009-03-29 Thread Malcolm Tredinnick
On Sun, 2009-03-29 at 17:15 -0700, Oliver Beattie wrote: > I figured that might be the case. I am wrapping the backend now in > tests, I just hate monkey patching :) There should be no monkey-patching involved. Using a separate settings file for tests so that it points to its own cache isn't monk

Re: Signals sent by the cache framework?

2009-03-29 Thread Oliver Beattie
; Hey Everyone, > > > I just wanted to poll opinion on a feature request I'm considering > > posting a ticket for (and obviously write a patch for). Basically, I > > want the cache framework to send signals whenever it interacts with > > the cache (things like cache

Re: Signals sent by the cache framework?

2009-03-29 Thread Malcolm Tredinnick
On Sun, 2009-03-29 at 16:28 -0700, Oliver Beattie wrote: > Hey Everyone, > > I just wanted to poll opinion on a feature request I'm considering > posting a ticket for (and obviously write a patch for). Basically, I > want the cache framework to send signals whenever it intera

Signals sent by the cache framework?

2009-03-29 Thread Oliver Beattie
Hey Everyone, I just wanted to poll opinion on a feature request I'm considering posting a ticket for (and obviously write a patch for). Basically, I want the cache framework to send signals whenever it interacts with the cache (things like cache_hit, cache_miss, cache_set, cache_deleted