Code Monkey home page Code Monkey logo

Comments (9)

ReneKroon avatar ReneKroon commented on June 9, 2024 1

ok, the bolt example looks very good!

from ttlcache.

adam-p avatar adam-p commented on June 9, 2024 1

Regarding the SimpleCache question: As an outsider shopping around for caches and reading your README and godoc, I don't see what SimpleCache provides. I can see that Cache implements it. Am I also supposed to implement it if I wanted... something? A different backend? But then I'd just use a different cache.

Unless I'm missing something, I don't think it's useful. (If it's just intended as a tidy collection of the available methods, it's not needed.)

from ttlcache.

swithek avatar swithek commented on June 9, 2024 1

The v3 has been released.

from ttlcache.

jpmeijers avatar jpmeijers commented on June 9, 2024 1

Being forced to move away from the ReneKroon cache now. It's quite a hassle changing my code to work with this repo. I wish there was a SimpleCache.

from ttlcache.

ReneKroon avatar ReneKroon commented on June 9, 2024

These sound like solid improvements. Maybe leave the SimpleCache in the front example so that it's easy for people to get started?

from ttlcache.

swithek avatar swithek commented on June 9, 2024

Do you mean leave the SimpleCache interface only as an example in the README? If so, I don't think that would give much value, since all the exported methods can be seen on the godoc page. Knowing those methods, it's not hard to design your own interface that contains only the methods you need (e.g. only Set and Purge).

from ttlcache.

ReneKroon avatar ReneKroon commented on June 9, 2024

I do think it lowers the entry barrier for people looking 'just a cache with TTL' to seconds instead of having to study the docs. I think it's an easy way to improve exposure of the library.

from ttlcache.

swithek avatar swithek commented on June 9, 2024

Sooner or later one would have to study the docs to know how to properly use the library. However, having a few good examples that show the basic and advanced usage, like now, is useful. I'm not suggesting these examples should be removed, I just don't see how they can be better with an interface defined in them. If anything, having too much information like this increases the confusion (what if the user doesn't want to use an interface at all?) That's why the examples should be simple and to the point: they should show the usage of the most important methods, not how they can be used with other language elements. After all, if one is using go, they should already know how things like methods and interfaces work.

What I am proposing we should have is a straightforward README file with code that is somewhat similar to bolt's: https://github.com/boltdb/bolt

from ttlcache.

swithek avatar swithek commented on June 9, 2024

I also think we should have only one Get method that returns an exported *Item (its fields would remain unexported, but their accessor methods would be exported). This way we wouldn't have to create a new GetX method each time a new piece of data is needed (e.g. ttl -> GetWithTTL). How does that sound @ReneKroon?

from ttlcache.

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.