Sha256: 0bc4399f8ea6cc06442c04a1203736799a0719227694d73113b8f632c93d5289

Contents?: true

Size: 827 Bytes

Versions: 7

Compression:

Stored size: 827 Bytes

Contents

# frozen_string_literal: true

module Basquiat
  module Adapters
    class RabbitMq
      class BaseStrategy
        class << self
          def session_options
            {}
          end

          def setup(options = {})
            @options = options
          end
        end

        def initialize(session)
          @session = session
        end

        def run(_message)
          raise Basquiat::Errors::SubclassResponsibility
        end

        def ack(message)
          @session.channel.ack(message.delivery_tag)
        end

        def nack(message)
          @session.channel.nack(message.delivery_tag, false)
        end

        def requeue(message)
          @session.channel.nack(message.delivery_tag, false, true)
        end

        private

        attr_reader :session
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
basquiat-1.6.0 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.5.2 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.5.1 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.5.0 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.4.0 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.3.6 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.3.5 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb