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.