Created
          March 8, 2010 14:53 
        
      - 
      
 - 
        
Save stormgrind/325221 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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