ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.9k stars 97 forks source link

[BUG] 🧽 Better cleanup while disposing #150

Closed jodydonetti closed 1 year ago

jodydonetti commented 1 year ago

Problem

In FusionCache when Dispose() is called all the plugins used by an instance are removed automatically, so that everything is kept clean at the end, like this (pseudo-code):

void Dispose()
{
  RemoveAllPlugins();
}

The same is not done for the distributed cache and the backplane.

Solution

Start also removing both the distributed cache (if any) and the backplane (if any). Something like this (again, pseudo-code):

void Dispose()
{
  RemoveAllPlugins();
  RemoveBackplane();
  RemoveDistributedCache();
}

This will "detach" distributed caches or backplanes from their respective FusionCache instances.

jodydonetti commented 1 year ago

Hi all, v0.22.0 has been released and this is included 🎉