Sha256: e18cbe4aae9c0529761d6d4ef6025de62024725875c75365bf063bb3245ce22c

Contents?: true

Size: 546 Bytes

Versions: 7

Compression:

Stored size: 546 Bytes

Contents

class Freddy
  module Consumers
    class ResponseConsumer
      def initialize(logger)
        @logger = logger
      end

      def consume(channel, queue, &block)
        @logger.debug "Consuming messages on #{queue.name}"
        queue.subscribe do |delivery|
          process_message(channel, queue, delivery, &block)
        end
      end

      private

      def process_message(channel, queue, delivery, &block)
        Consumers.log_receive_event(@logger, queue.name, delivery)
        block.call(delivery)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
freddy-1.1.0 lib/freddy/consumers/response_consumer.rb
freddy-1.0.1 lib/freddy/consumers/response_consumer.rb
freddy-jruby-1.0.0 lib/freddy/consumers/response_consumer.rb
freddy-1.0.0 lib/freddy/consumers/response_consumer.rb
freddy-jruby-0.7.2 lib/freddy/consumers/response_consumer.rb
freddy-0.7.2 lib/freddy/consumers/response_consumer.rb
freddy-0.7.1 lib/freddy/consumers/response_consumer.rb