Marshal / memcache "can't dump anonymous module"

Discussion in 'Ruby' started by benny, Apr 25, 2005.

  1. benny

    benny Guest

    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
    benny, Apr 25, 2005
    #1
    1. Advertising

  2. benny

    Evan Webb Guest

    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 //

    On 4/25/05, benny <> wrote:
    > 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
    >
    >
    Evan Webb, Apr 25, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    522
    Aaron Watters
    Jun 18, 2008
  2. Sean Reifschneider
    Replies:
    0
    Views:
    545
    Sean Reifschneider
    Dec 17, 2010
  3. Michael Davis

    Ruby 1.8 and Marshal.load/Marshal.dump

    Michael Davis, Oct 10, 2003, in forum: Ruby
    Replies:
    0
    Views:
    161
    Michael Davis
    Oct 10, 2003
  4. Michael Granger

    [ANN] MemCache 0.0.1

    Michael Granger, Nov 14, 2004, in forum: Ruby
    Replies:
    0
    Views:
    80
    Michael Granger
    Nov 14, 2004
  5. Michael Granger

    [ANN] Ruby-MemCache 0.0.2

    Michael Granger, Dec 2, 2004, in forum: Ruby
    Replies:
    0
    Views:
    79
    Michael Granger
    Dec 2, 2004
Loading...

Share This Page