Skip to content

Instantly share code, notes, and snippets.

@stormgrind
Created March 8, 2010 14:53
Show Gist options
  • Save stormgrind/325221 to your computer and use it in GitHub Desktop.
Save stormgrind/325221 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'torquebox-messaging-container'
require 'consumers/image_consumer'
require 'logger'
module BoxGrinderREST
class Node
def initialize
@log = Logger.new(STDOUT)
end
def listen
container = TorqueBox::Messaging::Container.new {
naming_provider_url 'jnp://10.1.0.13:1099/'
consumers {
map '/queues/boxgrinder/image', ImageConsumer
}
}
@log.info "Starting BoxGrinder REST node..."
container.start
@log.info "BoxGrinder REST node is started and waiting for tasks."
container.wait_until( 'INT' )
end
end
end
BoxGrinderREST::Node.new.listen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment