Sha256: c70c7b95103b276ba866ca0ca012379c8642f68442a56381a5219dacb9c92461

Contents?: true

Size: 531 Bytes

Versions: 35

Compression:

Stored size: 531 Bytes

Contents

require 'resque'
require 'routemaster/jobs/job'

module Routemaster
  module Jobs
    module Backends
      class Resque
        def initialize(adapter = nil)
          @adapter = adapter || ::Resque
        end

        def enqueue(queue, job_class, *args)
          job_data = Job.data_for(job_class, args)
          @adapter.enqueue_to(queue, JobWrapper, job_data)
        end

        class JobWrapper
          def self.perform(job_data)
            Job.execute(job_data)
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
routemaster-drain-3.7.1 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.7.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.8 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.7 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.6 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.5 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.4 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.3 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.2 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.1 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.6.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.5.1 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.5.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.4.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.3.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.2.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.1.0 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.0.3 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.0.2 lib/routemaster/jobs/backends/resque.rb
routemaster-drain-3.0.1 lib/routemaster/jobs/backends/resque.rb