Class: Aws::Rails::SqsActiveJob::JobRunner Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/rails/sqs_active_job/job_runner.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ JobRunner

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of JobRunner.



10
11
12
13
14
# File 'lib/aws/rails/sqs_active_job/job_runner.rb', line 10

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

Instance Attribute Details

#class_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/aws/rails/sqs_active_job/job_runner.rb', line 8

def class_name
  @class_name
end

#idObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/aws/rails/sqs_active_job/job_runner.rb', line 8

def id
  @id
end

Instance Method Details

#exception_executions?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


20
21
22
23
# File 'lib/aws/rails/sqs_active_job/job_runner.rb', line 20

def exception_executions?
  @job_data['exception_executions'] &&
    !@job_data['exception_executions'].empty?
end

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/aws/rails/sqs_active_job/job_runner.rb', line 16

def run
  ActiveJob::Base.execute @job_data
end