Sha256: 9d6d5b712a2bbd80d1c8ed78598fe8bbf8c2146f9cbafb958841255aa388f9a2

Contents?: true

Size: 393 Bytes

Versions: 2

Compression:

Stored size: 393 Bytes

Contents

module RosettaQueue

  class BaseManager
    attr_reader :consumers

    class << self
      def create
        manager = self.new
        yield manager
        manager
      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

2 entries across 2 versions & 1 rubygems

Version Path
rosetta_queue-0.5.2 lib/rosetta_queue/consumer_managers/base.rb
rosetta_queue-0.5.0 lib/rosetta_queue/consumer_managers/base.rb