Weakrefs and object caching

Hi,

i need to memorize in a Cache some object that i identify through a
attribute my_id.
base on some event i update the attributes of the objects in the cache
and when the processing is done i can remove the object from cache.

I found some solution:

The memoizable library that can serialize/deserialize object in memory
or in a file.

then the Weakrefs of ruby stdlib, in particular i’ve found this link:

http://eigenclass.org/hiki.rb?weakhash+and+weakref

For performance reasons and whatever what do you advise me to do?
examples,solutions, useful link?

thank you

:tele

On Oct 5, 2006, at 3:22 AM, tele wrote:

For performance reasons and whatever what do you advise me to do?
examples,solutions, useful link?

I wrote a fair amount about memoization in this blog post, including
a full implementation and a weak reference cache:

http://blog.grayproductions.net/articles/2006/01/20/caching-and-
memoization

Hope that helps.

James Edward G. II

really interesting!
i’ve a look

thank you

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs