Class: AdvancedSneakersActiveJob::DelayedPublisher
- Inherits:
-
BunnyPublisher::Base
- Object
- BunnyPublisher::Base
- AdvancedSneakersActiveJob::DelayedPublisher
- Includes:
- BunnyPublisher::Mandatory
- Defined in:
- lib/advanced_sneakers_activejob/delayed_publisher.rb
Overview
This publisher relies on TTL to keep messages in a queue. When TTL is reached, messages go to another exchange (see dlx_exchange_name param).
Instance Attribute Summary collapse
-
#dlx_exchange_name ⇒ Object
readonly
Returns the value of attribute dlx_exchange_name.
Instance Method Summary collapse
-
#initialize(exchange:, **options) ⇒ DelayedPublisher
constructor
A new instance of DelayedPublisher.
Constructor Details
#initialize(exchange:, **options) ⇒ DelayedPublisher
Returns a new instance of DelayedPublisher.
19 20 21 22 23 |
# File 'lib/advanced_sneakers_activejob/delayed_publisher.rb', line 19 def initialize(exchange:, **) super(**.merge(exchange: [exchange, 'delayed'].join('-'), exchange_options: { type: 'headers', durable: true })) @dlx_exchange_name = exchange end |
Instance Attribute Details
#dlx_exchange_name ⇒ Object (readonly)
Returns the value of attribute dlx_exchange_name.
17 18 19 |
# File 'lib/advanced_sneakers_activejob/delayed_publisher.rb', line 17 def dlx_exchange_name @dlx_exchange_name end |