Sha256: 6abc9d7ba8e3b517f111660faa1ab3174ce8f7d4343643407cbc19bae5fea81f

Contents?: true

Size: 653 Bytes

Versions: 19

Compression:

Stored size: 653 Bytes

Contents

require 'evrone/common/amqp'
require 'evrone/ci/message'

module Evrone
  module CI
    module Worker
      class JobsConsumer

        include Evrone::Common::AMQP::Consumer

        exchange 'ci.jobs'
        queue    'ci.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
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
evrone-ci-worker-0.2.0.pre28 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre27 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre26 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre25 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre24 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre23 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre22 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre21 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre20 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre19 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre18 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre17 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre15 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre14 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre13 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre12 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre11 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre10 lib/evrone/ci/worker/consumers/jobs_consumer.rb
evrone-ci-worker-0.2.0.pre9 lib/evrone/ci/worker/consumers/jobs_consumer.rb