Sha256: 46ddba0bb180bf088bc9c89ad8f8e7cacd0bb3f7d58c786a4626e7b617117b2f

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.3.0 lib/message_driver/message.rb