Sha256: 10ad8b5935109e2578b7f4d80628ea51aea474a989d409427fc92398bc1cdf69

Contents?: true

Size: 611 Bytes

Versions: 16

Compression:

Stored size: 611 Bytes

Contents

module Harness
  class ResqueQueue
    class SendGauge < Job
      @queue = :high

      def self.perform(attributes)
        gauge = Gauge.new attributes
        new.log gauge
      end
    end

    class SendCounter < Job
      @queue = :high

      def self.perform(attributes)
        counter = Counter.new attributes
        new.log counter
      end
    end

    def self.push(measurement)
      if measurement.is_a? Gauge
        Resque.enqueue SendGauge, measurement.attributes
      elsif measurement.is_a? Counter
        Resque.enqueue SendCounter, measurement.attributes
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
harness-0.2.15 lib/harness/queues/resque_queue.rb
harness-0.2.14 lib/harness/queues/resque_queue.rb
harness-0.2.13 lib/harness/queues/resque_queue.rb
harness-0.2.12 lib/harness/queues/resque_queue.rb
harness-0.2.11 lib/harness/queues/resque_queue.rb
harness-0.2.10 lib/harness/queues/resque_queue.rb
harness-0.2.9 lib/harness/queues/resque_queue.rb
harness-0.2.8 lib/harness/queues/resque_queue.rb
harness-0.2.7 lib/harness/queues/resque_queue.rb
harness-0.2.6 lib/harness/queues/resque_queue.rb
harness-0.2.5 lib/harness/queues/resque_queue.rb
harness-0.2.4 lib/harness/queues/resque_queue.rb
harness-0.2.3 lib/harness/queues/resque_queue.rb
harness-0.2.2 lib/harness/queues/resque_queue.rb
harness-0.2.1 lib/harness/queues/resque_queue.rb
harness-0.2.0 lib/harness/queues/resque_queue.rb