Skip to content

Use the AsyncKeyedMemoryLocker - #1256

Closed
MarkCiliaVincenti wants to merge 1 commit into
dotnet:mainfrom
MarkCiliaVincenti:AsyncKeyed
Closed

MarkCiliaVincenti wants to merge 1 commit into
dotnet:mainfrom
MarkCiliaVincenti:AsyncKeyed

Conversation

@MarkCiliaVincenti

Copy link
Copy Markdown

No description provided.

@kimpenhaus

Copy link
Copy Markdown
Collaborator

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!

@kimpenhaus kimpenhaus closed this Sep 20, 2026
@MarkCiliaVincenti

Copy link
Copy Markdown
Author

Brilliant, didn't realise about that! Cheers as well for the rest of your comments :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants