Sha256: 7559122756c9cd75e617f472bef1b9de444cebf6283a94231bc32df01222cc8f

Contents?: true

Size: 756 Bytes

Versions: 12

Compression:

Stored size: 756 Bytes

Contents

require 'adaptation'

environment = "development" # TODO: "un-hardcode" this
config = YAML::load(File.open("config/mom.yml"))["development"]

case config["mom"]["type"]
  when "druby"
    require 'adaptation/druby_subscriber'

    mom_uri = "druby://#{config["mom"]["host"]}:#{config["mom"]["port"]}"
    subscriber_uri = "druby://#{config["subscriber"]["host"]}:#{config["subscriber"]["port"]}"
    topics = config["subscriber"]["topics"].split(' ')
    
    Signal.trap("INT") { puts "Shutting down subscriber (#{config["mom"]["type"]})"; exit }

    oapdaemon = Adaptation::Mom::DrubySubscriber.new subscriber_uri, mom_uri, topics
    oapdaemon.start

  #when "xmlblaster"
    #

  else
    puts "Unknown MOM server type: #{config["mom"]["type"]}"
end

Version data entries

12 entries across 11 versions & 1 rubygems

Version Path
adaptation-0.0.5 lib/commands/subscribe.rb
adaptation-0.0.3 lib/commands/subscribe.rb
adaptation-0.0.4 lib/commands/subscribe.rb
adaptation-0.0.6 lib/commands/subscribe.rb
adaptation-0.0.7 lib/commands/subscribe.rb
adaptation-0.0.8 lib/commands/subscribe.rb
adaptation-0.0.9 lib/commands/subscribe.rb
adaptation-0.1.0 lib/commands/subscribe.rb
adaptation-0.0.3 lib/commands/subscribe.rb~
adaptation-0.1.2 lib/commands/subscribe.rb
adaptation-0.1.3 lib/commands/subscribe.rb
adaptation-0.1.1 lib/commands/subscribe.rb