Sha256: f24b1de20f664d867dfd005ea4674d6a666bddadcb1b59fe3b8e030166727e31

Contents?: true

Size: 372 Bytes

Versions: 5

Compression:

Stored size: 372 Bytes

Contents

module RosettaQueue
  
  class BaseManager
    attr_reader :consumers

    class << self
      def create
        yield self.new
      end
    end
    
    def initialize
      @consumers  = {}
    end
    
    def add(message_handler)
      key = message_handler.class.to_s.underscore.to_sym
      @consumers[key] = Consumer.new(message_handler)
    end
    
  end  
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
bmabey-rosetta_queue-0.2.0 lib/rosetta_queue/consumer_managers/base.rb
cwyckoff-rosetta_queue-0.1.4 lib/rosetta_queue/consumer_managers/base.rb
cwyckoff-rosetta_queue-0.2.1 lib/rosetta_queue/consumer_managers/base.rb
cwyckoff-rosetta_queue-0.2.2 lib/rosetta_queue/consumer_managers/base.rb
cwyckoff-rosetta_queue-0.3.0 lib/rosetta_queue/consumer_managers/base.rb