Sha256: 8e32287095d7688015d79ca2ef36c745929af5f212dda7e5cb3d283358b41844

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

module Vx
  module Consumer
    module Ack

      def ack(multiple = false)
        instrumentation = {
          consumer:      self.class.params.consumer_name,
          properties:    properties,
          multiple:      multiple,
          channel:       _channel.id
        }
        if _channel.open?
          _channel.ack delivery_info.delivery_tag, multiple
          instrument("ack", instrumentation)
          true
        else
          instrument("ack_failed", instrumentation)
          false
        end
      end

      def nack(multiple = false, requeue = false)
        instrumentation = {
          consumer:      self.class.params.consumer_name,
          properties:    properties,
          multiple:      multiple,
          requeue:       requeue,
          channel:       channel.id
        }
        if _channel.open?
          _channel.ack delivery_info.delivery_tag, multiple, requeue
          instrument("nack", instrumentation)
          true
        else
          instrument("nack_failed", instrumentation)
          false
        end
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vx-consumer-0.2.0 lib/vx/consumer/ack.rb
vx-consumer-0.2.0.pre0 lib/vx/consumer/ack.rb
vx-consumer-0.1.8 lib/vx/consumer/ack.rb
vx-consumer-0.1.7 lib/vx/consumer/ack.rb
vx-consumer-0.1.6 lib/vx/consumer/ack.rb
vx-consumer-0.1.5 lib/vx/consumer/ack.rb
vx-consumer-0.1.4 lib/vx/consumer/ack.rb
vx-consumer-0.1.3 lib/vx/consumer/ack.rb