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. Advertisements

  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. Advertisements

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:
    764
    Aaron Watters
    Jun 18, 2008
  2. Sean Reifschneider
    Replies:
    0
    Views:
    668
    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:
    296
    Michael Davis
    Oct 10, 2003
  4. Michael Granger

    [ANN] MemCache 0.0.1

    Michael Granger, Nov 14, 2004, in forum: Ruby
    Replies:
    0
    Views:
    178
    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:
    199
    Michael Granger
    Dec 2, 2004
  6. Michael Granger

    [ANN] Ruby-MemCache 0.0.4

    Michael Granger, Oct 14, 2005, in forum: Ruby
    Replies:
    0
    Views:
    162
    Michael Granger
    Oct 14, 2005
  7. George Moschovitis
    Replies:
    1
    Views:
    318
    James Britt
    Mar 7, 2006
  8. hemant kumar

    regarding memcache client...

    hemant kumar, Aug 30, 2006, in forum: Ruby
    Replies:
    2
    Views:
    182
    Eric Hodel
    Aug 31, 2006
Loading...