Class: Basquiat::Adapters::RabbitMq::BaseStrategy
- Inherits:
-
Object
- Object
- Basquiat::Adapters::RabbitMq::BaseStrategy
show all
- Defined in:
- lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseStrategy.
17
18
19
|
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb', line 17
def initialize(session)
@session = session
end
|
Class Method Details
.session_options ⇒ Object
8
9
10
|
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb', line 8
def session_options
{}
end
|
.setup(options = {}) ⇒ Object
12
13
14
|
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb', line 12
def setup(options = {})
@options = options
end
|
Instance Method Details
#ack(message) ⇒ Object
25
26
27
|
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb', line 25
def ack(message)
@session.channel.ack(message.delivery_tag)
end
|
#nack(message) ⇒ Object
29
30
31
|
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb', line 29
def nack(message)
@session.channel.nack(message.delivery_tag, false)
end
|
#requeue(message) ⇒ Object
33
34
35
|
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb', line 33
def requeue(message)
@session.channel.nack(message.delivery_tag, false, true)
end
|