Sha256: 81a101fa702eb52fc92ff8b159fcf930bf9f7c52675fba3c9c316c138695bbd4

Contents?: true

Size: 1.18 KB

Versions: 54

Compression:

Stored size: 1.18 KB

Contents

module ActionSubscriber
  class Route
    attr_reader :acknowledgements,
                :action,
                :durable,
                :exchange,
                :prefetch,
                :queue,
                :routing_key,
                :subscriber,
                :threadpool_name

    def initialize(attributes)
      @acknowledgements = attributes.fetch(:acknowledgements)
      @action = attributes.fetch(:action)
      @durable = attributes.fetch(:durable)
      @exchange = attributes.fetch(:exchange).to_s
      @prefetch = attributes.fetch(:prefetch) { ::ActionSubscriber.config.prefetch }
      @queue = attributes.fetch(:queue)
      @routing_key = attributes.fetch(:routing_key)
      @subscriber = attributes.fetch(:subscriber)
      @threadpool_name = attributes.fetch(:threadpool_name)
      if attributes.has_key?(:concurrency)
        concurrency = attributes[:concurrency]
        ::ActionSubscriber.print_deprecation_warning("setting prefetch for #{@queue} to #{concurrency}")
        @prefetch = concurrency
      end
    end

    def acknowledgements?
      @acknowledgements
    end

    def queue_subscription_options
      { :manual_ack => acknowledgements? }
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
action_subscriber-5.3.3-java lib/action_subscriber/route.rb
action_subscriber-5.3.3 lib/action_subscriber/route.rb
action_subscriber-5.3.2-java lib/action_subscriber/route.rb
action_subscriber-5.3.2 lib/action_subscriber/route.rb
action_subscriber-5.3.1-java lib/action_subscriber/route.rb
action_subscriber-5.3.1 lib/action_subscriber/route.rb
action_subscriber-5.3.1.pre-java lib/action_subscriber/route.rb
action_subscriber-5.3.1.pre lib/action_subscriber/route.rb
action_subscriber-5.3.0-java lib/action_subscriber/route.rb
action_subscriber-5.3.0 lib/action_subscriber/route.rb
action_subscriber-5.2.4-java lib/action_subscriber/route.rb
action_subscriber-5.2.4 lib/action_subscriber/route.rb
action_subscriber-5.2.3-java lib/action_subscriber/route.rb
action_subscriber-5.2.3 lib/action_subscriber/route.rb
action_subscriber-5.2.2-java lib/action_subscriber/route.rb
action_subscriber-5.2.2 lib/action_subscriber/route.rb
action_subscriber-5.2.1-java lib/action_subscriber/route.rb
action_subscriber-5.2.1 lib/action_subscriber/route.rb
action_subscriber-5.2.0-java lib/action_subscriber/route.rb
action_subscriber-5.2.0 lib/action_subscriber/route.rb