From: Phlip Date: 2008-01-26T13:10:00+09:00 Subject: Re: Ruby Class Object Serialization -- HELP Jack Xu wrote: > I have created a ruby class at runtime with its methods created using > class_eval, and I would like to share this class definition on all the > clustered servers. One way I can think of doing is to marshal/serialize > it up and send it to memcache, so that other servers can access it. > Obviously, this doesn't work because according to Module class > definition: "bindings, procedure or method objects, instances of class > IO, or singleton objects can't be dumped". In theory, because the class fully exists at runtime as a big stack of nodes (essentially the p-code of Ruby), one could "disassemble" those p-codes, and reconstitute classes as source. Then one could trivially mail these around. Ask if you'd like to do it that way and I'l set you up. However, I can't help thinking your outer problem could use a re-think. Can you use DRb (Distributed Ruby), send handles to these objects out to the other hosts, and let them call your objects? or would that load the system the wrong way? -- Phlip