GithubHelp home page GithubHelp logo

Comments (5)

gautema avatar gautema commented on July 27, 2024

Do you actually get an exception? They should be removed from the dictionary when the are removed from the MemoryCache. Line 27 in CacheRepository is where the callback is registered.

https://github.com/gautema/CQRSlite/blob/master/Framework/CQRSlite/Cache/CacheRepository.cs#L27

from cqrslite.

Narvalex avatar Narvalex commented on July 27, 2024

You are right. Thanks

from cqrslite.

Narvalex avatar Narvalex commented on July 27, 2024

I think there is still a chance of a race condition. If the lock is removed just after a thread grabs it, a second thread will create a new entry in the dictionary and there will be two concurrent threads racing for the same stream. Makes any sense?

from cqrslite.

gautema avatar gautema commented on July 27, 2024

While this is so unlikely it will probably never happen, it will just behave like a when the regular repository gets two commands on the same time. If an exception is thrown, it will be removed from the cache again

from cqrslite.

Narvalex avatar Narvalex commented on July 27, 2024

Ok, I am agree that there is mechanism to recover from it, but the pesimistic lock is a bit optimistic, just a bit indeed. Maybe we should point out that, since Im sure there are guys that might use this approach for high contention scenarios where there is not a mechanism to recover from a failure.

from cqrslite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.