Use the AsyncKeyedMemoryLocker - #1256
MarkCiliaVincenti wants to merge 1 commit into
Conversation
|
Hi @MarkCiliaVincenti, thanks a lot for taking the time to open this — much appreciated, and AsyncKeyedLock is genuinely a great piece of work. That said, we'd like to keep KubeOps.Abstractions as our lowest-level package with as few dependencies as possible, since everything else in the SDK builds on top of it. Adding the locking plugin there would push AsyncKeyedLock onto every consumer transitively. The good news is that this doesn't need to live in the core package at all — the cache is already fully configurable, so anyone who wants it can opt in on their side in a single line: builder.Services.AddKubernetesOperator(b => b.WithResourceWatcherEntityCaching(
cache => cache
.WithoutDistributedCache()
.WithMemoryLocker(new AsyncKeyedMemoryLocker())
.WithOptions(o => o.DefaultEntryOptions.SetDuration(TimeSpan.MaxValue))));So I'm going to close this one — not because the idea isn't good, but because we'd rather leave the choice to the consumer. Thanks again for the contribution! |
|
Brilliant, didn't realise about that! Cheers as well for the rest of your comments :) |
No description provided.