rubyamf + eventmachine

2 views
Skip to first unread message

pdubya

unread,
Apr 2, 2008, 9:30:36 PM4/2/08
to rubyamf
Hi All,
I've put together a couple of very simple apps using the rubyamf rails
plugin, and I'd like to go to the next level and push data to clients
in real time. I've got a very simple prototype of a push server
running with eventmachine, but the client side is a little messy
because I'm basically deserializing strings off of the socket. I'd
like to use amf to serialize/deserialize, but I really don't need to
use rails for this.
I know that rubyamf-lite was killed for lack of interest, but would
this have been a job for that? I'm going to pull down the last
version with lite, but I'm curious how people think I ought to
approach this.

Thanks

Aaron Smith

unread,
Apr 3, 2008, 5:06:57 AM4/3/08
to rub...@googlegroups.com
I'd actually really like to see this. As far as how to go about doing it, yes use the last version of rubyamf lite - there is a tag in SVN. Here's what you want to do for integrating eventmachine..

1 Take a look at the source code for the last rubyamf lite. You'll notice that the current core architecture behind rubyamf rails hasn't changed too drastically from rubyamf lite. The biggest difference is that in lite - there were "adapters," but now we don't need them. I would say leave everything as is until eventmachine is integrated.

2 Integrate eventmachine into rubyamf lite.

3 Take out Adapters from RubyAMF Lite, then use the Deserializer/Serializer from the current RubyAMF version. You want those because they're much much faster. There will be a couple places where references to the rails specific version will nee to be commented out. it's usually just like one or two lines that trigger case swapping for incoming / outgoing VO's properties.

4. You'll also have to look at how custom class mappings work and the differences between lite and rails. the rails version has much better class mapping support, so id' take all that is necessary for that as well, and integrate into lite. 

5 After integrating possibly do some refactoring if you think it's necessary.

So basically you want to integrate event machine first, but then switch some of the guts of lite to be the rails version, of course taking out rails specific code.

That would be the just of it.
-Aaron

Peter Williams

unread,
Apr 3, 2008, 10:20:09 PM4/3/08
to rub...@googlegroups.com
Hi Aaron, 
Thanks for the tips.  I'll try out what you suggested this weekend.  Just to get me started can you elaborate a little on what you mean by integrate eventmachine into ramf lite?  Can I follow the lighttpd, mongrel, and webrick in the server folder as examples? 

thanks, 
Pete 

Aaron Smith

unread,
Apr 3, 2008, 11:19:19 PM4/3/08
to rub...@googlegroups.com
Hey peter. Yeah all I meant was taking however u integrated event machine in ramf rails. Just do the same in lite. I'd have to see the  example u have working with event machine to tell u if u can follow the other server integrations. 

Aaron
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "rubyamf" group.
To post to this group, send email to rub...@googlegroups.com
To unsubscribe from this group, send email to rubyamf-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyamf?hl=en
-~----------~----~----~----~-
Reply all
Reply to author
Forward
0 new messages