Sha256: d18b5099c55a30e23d998e54188476750abab08c4c8b0ad206367c3a1068fad8

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

module Vx
  module Lib
    module Consumer
      module Instrument

        def instrument(name, payload, &block)
          name = "#{name}.consumer.vx".freeze

          if Consumer.configuration.debug?
            $stdout.puts " --> #{name}: #{payload}"
          end

          if Consumer.configuration.instrumenter
            Consumer.configuration.instrumenter.instrument(name, payload, &block)
          else
            begin
              yield if block_given?
            rescue Exception => e
              Consumer.handle_exception(e, {})
            end
          end
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vx-lib-consumer-0.2.2 lib/vx/lib/consumer/instrument.rb
vx-lib-consumer-0.2.1 lib/vx/lib/consumer/instrument.rb