"Evented" Loudmouth ruby binding

8 views
Skip to first unread message

Raphael Simon

unread,
Mar 2, 2009, 3:00:27 AM3/2/09
to loudmo...@googlegroups.com, jer...@rightscale.com
Hi all,

I have finished the initial implementation for the evented branch of the Loudmouth ruby binding. What this means is that:

1. It is now possible to implement non-blocking handling of XMPP messages in ruby (e.g. using EventMachine's popen). The GLib event loop runs in a different (kernel) thread as the ruby thread.
2. The ruby code does not need the 'glib2' gem anymore. This is good because installing ruby-gnome2 isn't a fun thing to do.
3. The old behavior is still available. The old example and test work as is on the branch. In this case there is only one thread, it's the exact same implementation as before.

There is an 'evented_spec.rb' file in the spec folder that shows how to use the evented connection. All in all the code is very similar but is using EventMachine instead of GLib. I will be writing more elaborate examples and documentation in the near future, in the mean time you can grab the latest from http://github.com/raphael/loudmouth-ruby/tree/evented.

This should probably become part of the official Loudmouth ruby binding pending review and appoval of course. Dropping the old behavior would also allow for additional cleanup and removal of duplication so it is an option to consider.

The next phase would be to leverage this in the Vertebra ruby agent library.

--
Raphael.


Raphael Simon

unread,
Mar 2, 2009, 3:07:51 AM3/2/09
to loudmo...@googlegroups.com, jer...@rightscale.com
I forgot to mention that this requires a patched EventMachine build. Theres is a bug in the current EventMachine build that will prevent it from correctly handling notifications coming from pipes. See http://rubyeventmachine.com/ticket/107 for details and the patch (Proposed Fix).

--
Raphael.

wyha...@gmail.com

unread,
Mar 2, 2009, 8:17:14 AM3/2/09
to loudmo...@googlegroups.com
You are my hero Raphael. I will be testing this TODAY.

Thank you,

Kirk Haines
Developer
Engine Yard

Sent from my Verizon Wireless BlackBerry


From: Raphael Simon
Date: Mon, 2 Mar 2009 00:00:27 -0800
To: <loudmo...@googlegroups.com>
Subject: [loudmouth-dev] "Evented" Loudmouth ruby binding

Reply all
Reply to author
Forward
0 new messages