ruby stomp gem version 1.0.3 released

Thanks to Brian McCallister, he put in the changes I mentioned.

This should make the changes to a13g cleaner, and we can now take advantage of having the reconnect wait time configurable.
All in all, it makes a13g closer to implementing a ‘reliable’ listening service.

There is one sorta ugly bit, the __old_receive method was a fine way to do this when I was extending the Connection class, but could use refactoring…after I get a good check in of fixes to a13g, I’ll submit something prettier. But as we used to say back in Stanley Eisenstat’s classes (which I wish I had taken more of): good is great, but done is better.

ActiveMessaging (a13g)

Jon Tirsen and friends created a great product, ActiveMessaging, to incorporate into Rails the ability to send and receive Stomp messages – specifically, this seems to mostly be used with ActiveMQ and its Stomp protocol support, and depends on the Ruby Stomp client courtesy Brian McCallister.

Since I am using a13g quite actively at prx, Jon has been kind enough to let me help maintain this product, and hopefully even add some to it. There is now a google code site, and a mailing list, thanks Jon.

First up are some bug fixes and quick enhancements – I sent a few in to Brian McCallister that will hopefully show up in a 1.0.3 release of the Ruby Stomp client. I also have a few fixes and minor enhancements to make to a13g that should show up soon, and I will also be working on any issues logged on the new google code site.

But what to do after that? I have some examples I want to throw out there for doing synchronous messaging between a rails and a java app, and I want to add even more documentation to the wiki so folks can get going with this easier – what else do people want? Get on the mailing list and let’s talk about it.

hours of halloween audio fun


Checkout the scream stream of free halloween public radio, brought to you for gratis by the fine folks at PRX.

FeedTools and FeedUpdater fun

Playing around with FeedTools and FeedUpdater.
Fun stuff.

Had a few lessons learned I wanted to share:

1) load the rails app feed config file

To get FeedUpdater to find my ‘feed_updater.yml’ file, I had to make a small change to some of the file loading logic. It kept loading the example/default comfig – so I changed the list of paths to look for my file first, by climbing out of the vendor directory, and getting the file in the regular rails app config directory.

config_file = FileStalker.hunt([
"./feed_updater.yml",
"../config/feed_updater.yml"
])

to:

config_file = FileStalker.hunt([
"../../../config/feed_updater.yml",
"./feed_updater.yml",
"../config/feed_updater.yml"])

2) Use the rails app model objects in the custom updater script.

This took some experimentation to figure out.

As the rails wiki says, you need to require the environment script to be able to use the rails app goodies in a standalone script. But where, pray-tell, should you put this require?

Use the on_begin method of the custom script.
So if you have in your ‘feed_updater.yml’:

load_script: lib/my_feed_updater.rb

Then in this file, you need something like the following:

class MyFeedUpdater < FeedTools::FeedUpdater

on_begin do
#load all thing needed to use rails app stuff
require File.dirname(__FILE__) + '/../config/environment'

#use your model like its going out of style
end

on_update do |feed, seconds|
self.logger.info("Loaded '#{feed.href}'. Updated (#{feed.title}) in #{seconds} seconds.")
end

on_error do |href, error|
self.logger.info("Error updating '#{href}':")
self.logger.info(error)
end

on_complete do |updated_feed_hrefs|
end
end

Hope someone else gets some fun out of this.

Decreation – Anne Carson, triple threat

Working my way through Decreation by Anne Carson.

I got tipped by a literati family member to Autobiography of Red awhile back, and so when my local amazing bookstore posted the new book to their poetry section, I snagged it. And then a week or so later came the review in the aptly named Boston Review.

I can’t do it justice, I’m just trying to appreciate it – go read for yourself.

The Knopf site has clips of the author performing pieces of this. Can you beat that?