Better HN
topnewbestaskshowjobs
Log inSign up

hp_hovercraft84

13 karma · joined Sep 29, 2022 (4y ago) · 8 submissions

Submissions

comment 1y ago · link · parent

Good call, but I think I would like to ensure it remains thread-safe as @store is a hash. Although I will consider something like this in a future update. Thanks!

comment 1y ago · link · parent

This is why I love working with Ruby!

comment 1y ago · link · parent

That's actually a really good idea! I'll definitely consider this in a future update. Thanks!

comment 1y ago · link · parent

Good question. I built this gem because I needed a few things that Rails.cache (and Redis) didn’t quite fit:

- Local and zero-dependency. It caches per object in memory, so no Redis setup, no serialization, no network latency. -Isolated and self-managed. Caches aren’t global. Each object/method manages its own LRU + TTL lifecycle and can be cleared with instance helpers. - Easy to use — You just declare the method, set the TTL and max size, and you're done. No key names, no block wrapping, no external config.

comment 1y ago · link · parent

As in identify where the source code is in the README?

comment 1y ago · link · parent

Thanks for the feedback! That's a very good point, I'll update the gem and let it bubble up.

7.

Show HN: I built a Ruby gem that handles memoization with a ttl(github.com ↗)

48 points · by hp_hovercraft84 · 1y ago · 26 comments

comment 4y ago · link · parent

No info about how the product works, immediate close.