Sha256: cc0c8bdef2097bbc95521a473e5201096d1bd46accbaee5f87b532072d94a645

Contents?: true

Size: 580 Bytes

Versions: 13

Compression:

Stored size: 580 Bytes

Contents

require 'vx/common/amqp'
require 'vx/message'

module Vx
  module Worker
    class JobsConsumer

      include Vx::Common::AMQP::Consumer

      exchange 'vx.jobs'
      queue    'vx.worker.jobs'
      ack      true

      model Message::PerformJob

      def perform(message)
        Worker.logger.tagged self.class.consumer_id do
          job         = Job.new message
          number      = Thread.current[:consumer_id] || 0
          path_prefix = "/tmp/.test/job.#{number}"
          Worker.perform(job, path_prefix)
          ack!
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vx-worker-0.3.0.pre0 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.1 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre38 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre37 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre36 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre35 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre34 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre33 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre32 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre31 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre30 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre29 lib/vx/worker/consumers/jobs_consumer.rb
vx-worker-0.2.0.pre28 lib/vx/worker/consumers/jobs_consumer.rb