------ art_9319_13425100.1201453036907 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Phlip, thanks for the response. Yes, please let me know about the process to set up the p-code nodes. I am looking for a solution that essentially works like Marshal.dump (which serializes the attributes of a object and sending it around), but should also be able to carry the meta content such as attribute alias, methods, & associations (as in ActiveRecord::Base). The requirement is that, after these classes are constructed at run time, the app should be able to upload them to a memcache server and then download them to each cluster app server and quickly re-construct the classes (with its meta content) . I have thought about using DRb. Because these classes that are constructed at runtime are at the core of my app, I think using DRb is going to add too much overhead to the system performance. Plus these classes can be constructed at any app server. Jack On Jan 25, 2008 11:10 PM, Phlip <phlip2005 / gmail.com> wrote: > 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 > > ------ art_9319_13425100.1201453036907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Phlip, thanks for the response. Yes, please let me know about the process to set up the p-code nodes.<br><br>I am looking for a solution that essentially works like Marshal.dump (which serializes the attributes of a object and sending it around), but should also be able to carry the meta content such as attribute alias, methods, & associations (as in ActiveRecord::Base). The requirement is that, after these classes are constructed at run time, the app should be able to upload them to a memcache server and then download them to each cluster app server and quickly re-construct the classes (with its meta content) . <br> <br>I have thought about using DRb. Because these classes that are constructed at runtime are at the core of my app, I think using DRb is going to add too much overhead to the system performance. Plus these classes can be constructed at any app server. <br> <br>Jack <br><br><div class mail_quote">On Jan 25, 2008 11:10 PM, Phlip <<a href ailto:phlip2005 / gmail.com">phlip2005 / gmail.com</a>> wrote:<br><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div><div></div><div class j3C7c">Jack Xu wrote:<br>> I have created a ruby class at runtime with its methods created using<br>> class_eval, and I would like to share this class definition on all the<br>> clustered servers. One way I can think of doing is to marshal/serialize<br> > it up and send it to memcache, so that other servers can access it.<br>> Obviously, this doesn't work because according to Module class<br>> definition: "bindings, procedure or method objects, instances of class<br> > IO, or singleton objects can't be dumped".<br><br></div></div>In theory, because the class fully exists at runtime as a big stack of nodes<br>(essentially the p-code of Ruby), one could "disassemble" those p-codes, and<br> reconstitute classes as source. Then one could trivially mail these around. Ask<br>if you'd like to do it that way and I'l set you up.<br><br>However, I can't help thinking your outer problem could use a re-think. Can you<br> use DRb (Distributed Ruby), send handles to these objects out to the other<br>hosts, and let them call your objects? or would that load the system the wrong way?<br><br>--<br><font color 888888"> Phlip<br><br></font></blockquote> </div><br> ------ art_9319_13425100.1201453036907--