class ActionSubscriber::Route

Attributes

acknowledgements[R]
action[R]
durable[R]
exchange[R]
prefetch[R]
queue[R]
routing_key[R]
subscriber[R]
threadpool_name[R]

Public Class Methods

new(attributes) click to toggle source
# File lib/action_subscriber/route.rb, line 13
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

Public Instance Methods

acknowledgements?() click to toggle source
# File lib/action_subscriber/route.rb, line 30
def acknowledgements?
  @acknowledgements
end
queue_subscription_options() click to toggle source
# File lib/action_subscriber/route.rb, line 34
def queue_subscription_options
  { :manual_ack => acknowledgements? }
end