Sha256: 644132621523b42293206c1d1f60b813bf6ad906d5d25b25b1cf8c1e2f9edcf7

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

module MessageDriver
  module Message
    class Base
      include Logging

      attr_reader :ctx, :body, :headers, :properties

      def initialize(ctx, body, headers, properties)
        @ctx = ctx
        @body = body
        @headers = headers
        @properties = properties
      end

      def ack(options={})
        if ctx.supports_client_acks?
          ctx.ack_message(self, options)
        else
          logger.debug('this adapter does not support client acks')
        end
      end

      def nack(options={})
        if ctx.supports_client_acks?
          ctx.nack_message(self, options)
        else
          logger.debug('this adapter does not support client acks')
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
message-driver-0.4.0 lib/message_driver/message.rb