Marshal / memcache "can't dump anonymous module"

B

benny

Hi,

I want to use the ruby memcache client
(http://www.deveiate.org/code/Ruby-MemCache.html)
to store objects in the memcached-server.

Unfortunatly I need to store anonymous modules in the cache and the
ruby-memcache uses Marshal which doesn't allow to dump anonymous modules.

Is there a way to circumvent this behaviour?

BTW. Why doesn't Marshal allow such a thing?


benny
 
E

Evan Webb

anonymous module's can't be dumped because there is no name associated
with them, and thus no way to tag them in the Marshal'd output. To be
able to marshal them, you'd have to marshal the anonymous modules'
contents (method definitions with code for the methods, etc), which is
something ruby doesnt do (save for nodedump, etc which are not
standard).

Evan Webb // (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top