Class: ActionSubscriber::Route
- Inherits:
-
Object
- Object
- ActionSubscriber::Route
- Defined in:
- lib/action_subscriber/route.rb
Instance Attribute Summary collapse
-
#acknowledgements ⇒ Object
readonly
Returns the value of attribute acknowledgements.
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#durable ⇒ Object
readonly
Returns the value of attribute durable.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#prefetch ⇒ Object
readonly
Returns the value of attribute prefetch.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
-
#subscriber ⇒ Object
readonly
Returns the value of attribute subscriber.
-
#threadpool_name ⇒ Object
readonly
Returns the value of attribute threadpool_name.
Instance Method Summary collapse
- #acknowledgements? ⇒ Boolean
-
#initialize(attributes) ⇒ Route
constructor
A new instance of Route.
- #queue_subscription_options ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Route
Returns a new instance of Route.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 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 |
Instance Attribute Details
#acknowledgements ⇒ Object (readonly)
Returns the value of attribute acknowledgements.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def acknowledgements @acknowledgements end |
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def action @action end |
#durable ⇒ Object (readonly)
Returns the value of attribute durable.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def durable @durable end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def exchange @exchange end |
#prefetch ⇒ Object (readonly)
Returns the value of attribute prefetch.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def prefetch @prefetch end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def queue @queue end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def routing_key @routing_key end |
#subscriber ⇒ Object (readonly)
Returns the value of attribute subscriber.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def subscriber @subscriber end |
#threadpool_name ⇒ Object (readonly)
Returns the value of attribute threadpool_name.
3 4 5 |
# File 'lib/action_subscriber/route.rb', line 3 def threadpool_name @threadpool_name end |
Instance Method Details
#acknowledgements? ⇒ Boolean
30 31 32 |
# File 'lib/action_subscriber/route.rb', line 30 def acknowledgements? @acknowledgements end |
#queue_subscription_options ⇒ Object
34 35 36 |
# File 'lib/action_subscriber/route.rb', line 34 def { :manual_ack => acknowledgements? } end |