MichaCo / CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
http://cachemanager.michaco.net
Apache License 2.0
2.33k stars 457 forks source link

New version / Nuget packages #372

Open matthias-jauernig opened 1 year ago

matthias-jauernig commented 1 year ago

Any chance to get a new CacheManager version from the current changes in the "dev" branch? Especially the concurrency fix with https://github.com/MichaCo/CacheManager/commit/f2d6e113ad74a22d3ff413addbdf2b442574a0b2 addresses a current production issue on our side.

anthonymbower commented 1 year ago

We too are experiencing the concurrency issues and would very much appreciate a new version.

mertkokusen commented 1 year ago

@matthias-jauernig are you still using this library on prod? We are considering forking the repo to build dlls from dev branch, just wondering if it's stable?

matthias-jauernig commented 1 year ago

We are using "the library" in prod, but only the main branch. We got around the concurrency issue by wrapping the calls by ourselves.

mertkokusen commented 1 year ago

I see, thanks. Did you create locks per item key or wrapped the call site with a single lock object?

matthias-jauernig commented 1 year ago

In our case, we are locking by cache item type and cache region (if exists).

public static void AddLocked<T>(this ICacheManager<T> cacheManager, CacheItem<T> cacheItem)
{
    string lockKeyForAdd = typeof(T).FullName + (!string.IsNullOrEmpty(cacheItem.Region) ? ('-' + cacheItem.Region) : string.Empty);
    try
    {
        _lockProvider.Wait(lockKeyForAdd);
        cacheManager.Add(cacheItem);
    }
    finally
    {
        _lockProvider.Release(lockKeyForAdd);
    }
}

... where LockProvider is adapted from https://github.com/Darkseal/LockProvider/

mertkokusen commented 1 year ago

Thanks a lot. We implemented something similar by managing multiple semaphoreslim objects but LockProvider seems to be cleaner.

bbqchickenrobot commented 10 months ago

Is this library still supported - from this conversation it sounds like there are some issues with no updates, etc....

Mek7 commented 2 months ago

Unfortunately it looks like this project is dead :( I found a discussion also here