Class: ActionSubscriber::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/action_subscriber/route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Route

Returns a new instance of Route.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/action_subscriber/route.rb', line 15

def initialize(attributes)
  @acknowledgements = attributes.fetch(:acknowledgements)
  @action = attributes.fetch(:action)
  @concurrency = attributes.fetch(:concurrency, 1)
  @connection_name = attributes.fetch(:connection_name)
  @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)
end

Instance Attribute Details

#acknowledgementsObject (readonly)

Returns the value of attribute acknowledgements.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def acknowledgements
  @acknowledgements
end

#actionObject (readonly)

Returns the value of attribute action.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def action
  @action
end

#concurrencyObject (readonly)

Returns the value of attribute concurrency.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def concurrency
  @concurrency
end

#connection_nameObject (readonly)

Returns the value of attribute connection_name.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def connection_name
  @connection_name
end

#durableObject (readonly)

Returns the value of attribute durable.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def durable
  @durable
end

#exchangeObject (readonly)

Returns the value of attribute exchange.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def exchange
  @exchange
end

#prefetchObject (readonly)

Returns the value of attribute prefetch.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def prefetch
  @prefetch
end

#queueObject (readonly)

Returns the value of attribute queue.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def queue
  @queue
end

#routing_keyObject (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

#subscriberObject (readonly)

Returns the value of attribute subscriber.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def subscriber
  @subscriber
end

#threadpoolObject (readonly)

Returns the value of attribute threadpool.



3
4
5
# File 'lib/action_subscriber/route.rb', line 3

def threadpool
  @threadpool
end

Instance Method Details

#acknowledgements?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/action_subscriber/route.rb', line 28

def acknowledgements?
  @acknowledgements
end

#queue_subscription_optionsObject



32
33
34
# File 'lib/action_subscriber/route.rb', line 32

def queue_subscription_options
  { :manual_ack => acknowledgements? }
end