Sha256: 6144ab160b1989d08bce0559235d67b8bafa018c3ddf7471281b4970fd7377e9

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

Appfuel::Initialize.define('global.message_broker') do |config, container|
  unless config.key?(:sneakers)
    fail "[initializer message_broker] :sneakers not found"
  end

  consumer_keys = container['message_brokers.consumer_keys']
  unless consumer_keys.is_a?(Array)
    fail "[initializer message_broker] message_borker.consumers must be " +
         " an Array"
  end

  require 'sneakers'
  require 'sneakers/runner'

  Sneakers.configure(config[:sneakers])


  consumers = consumer_keys.each.inject([]) do |result, key|
    result << container[key]
    result
  end

  container.register("message_brokers.runner", Sneakers::Runner.new(consumers))
  nil
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appfuel-service-0.1.7 lib/appfuel/service/initializers/message_broker.rb
appfuel-service-0.1.6 lib/appfuel/service/initializers/message_broker.rb
appfuel-service-0.1.4 lib/appfuel/service/initializers/message_broker.rb