Sha256: a64f30d57154b9fddbc26e5940afcfef515a0aebec4d7f907a74ac52ac37ad89

Contents?: true

Size: 492 Bytes

Versions: 26

Compression:

Stored size: 492 Bytes

Contents

module Harness
  class Consumer
    def consume
      Thread.new do
        while measurement = queue.pop
          begin
          ensure
            mutex.synchronize { @finished = queue.empty? }
          end
        end
      end
    end

    def finished?
      @finished
    end

    private
    def queue
      Harness.queue
    end

    def adapter
      Harness.config.adapter
    end

    def mutex
      Harness.mutex
    end

    def logger
      Harness.logger
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
harness-0.9.1 lib/harness/consumer.rb
harness-0.9.0 lib/harness/consumer.rb
harness-0.8.1 lib/harness/consumer.rb
harness-0.8.0 lib/harness/consumer.rb
harness-0.7.0 lib/harness/consumer.rb
harness-0.6.0 lib/harness/consumer.rb
harness-0.5.0 lib/harness/consumer.rb
harness-0.4.0 lib/harness/consumer.rb
harness-0.3.0 lib/harness/consumer.rb
harness-0.2.16 lib/harness/consumer.rb
harness-0.2.15 lib/harness/consumer.rb
harness-0.2.14 lib/harness/consumer.rb
harness-0.2.13 lib/harness/consumer.rb
harness-0.2.12 lib/harness/consumer.rb
harness-0.2.11 lib/harness/consumer.rb
harness-0.2.10 lib/harness/consumer.rb
harness-0.2.9 lib/harness/consumer.rb
harness-0.2.8 lib/harness/consumer.rb
harness-0.2.7 lib/harness/consumer.rb
harness-0.2.6 lib/harness/consumer.rb