Sha256: c754035c76408cdf2007445a5041c10ada7007283e59b3860dbd22a26571d381

Contents?: true

Size: 437 Bytes

Versions: 3

Compression:

Stored size: 437 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Rails
    module SqsActiveJob
      class JobRunner
        attr_reader :id, :class_name

        def initialize(message)
          @job_data = Aws::Json.load(message.data.body)
          @class_name = @job_data['job_class'].constantize
          @id = @job_data['job_id']
        end

        def run
          ActiveJob::Base.execute @job_data
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws-sdk-rails-3.10.0 lib/aws/rails/sqs_active_job/job_runner.rb
aws-sdk-rails-3.9.1 lib/aws/rails/sqs_active_job/job_runner.rb
aws-sdk-rails-3.9.0 lib/aws/rails/sqs_active_job/job_runner.rb