Class: Legion::Transport::Queues::Agent
- Inherits:
-
Legion::Transport::Queue
- Object
- Queue
- Legion::Transport::Queue
- Legion::Transport::Queues::Agent
- Defined in:
- lib/legion/transport/queues/agent.rb
Constant Summary
Constants included from Common
Instance Method Summary collapse
-
#initialize(agent_id: nil) ⇒ Agent
constructor
A new instance of Agent.
- #queue_name ⇒ Object
- #queue_options ⇒ Object
Methods inherited from Legion::Transport::Queue
#acknowledge, #default_options, #delete, #dlx_enabled, #dlx_exchange_name, #ensure_dlx, #nack_or_dlq, #own_queue?, #passive?, #recreate_queue, #reject
Methods included from Common
#channel, #channel_open?, #close, #close!, #deep_merge, #generate_consumer_tag, #open_channel, #options_builder
Constructor Details
#initialize(agent_id: nil) ⇒ Agent
Returns a new instance of Agent.
7 8 9 10 |
# File 'lib/legion/transport/queues/agent.rb', line 7 def initialize(agent_id: nil, **) @agent_id = agent_id super(**) end |
Instance Method Details
#queue_name ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/legion/transport/queues/agent.rb', line 12 def queue_name if @agent_id "agent.#{@agent_id}" else "agent.#{Legion::Settings['client']['name']}" end end |
#queue_options ⇒ Object
20 21 22 |
# File 'lib/legion/transport/queues/agent.rb', line 20 def { durable: false, auto_delete: true, arguments: { 'x-dead-letter-exchange': 'agent.dlx', 'x-queue-type': 'classic' } } end |