Sha256: 135f491e605e43f648ff291e36aaf75aeb2332096e21ade3fe3ccbce3cff2900

Contents?: true

Size: 717 Bytes

Versions: 3

Compression:

Stored size: 717 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

        private

        attr_reader :session
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basquiat-1.3.2 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.3.1 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb
basquiat-1.3.0 lib/basquiat/adapters/rabbitmq/requeue_strategies/base_strategy.rb