Class: Shoryuken::ActiveJob::JobWrapper Private
- Inherits:
-
Object
- Object
- Shoryuken::ActiveJob::JobWrapper
- Includes:
- Worker
- Defined in:
- lib/shoryuken/active_job/job_wrapper.rb
Overview
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.
Internal worker class that processes ActiveJob jobs. This class bridges ActiveJob’s interface with Shoryuken’s worker interface.
Instance Method Summary collapse
-
#perform(sqs_msg, hash) ⇒ Object
private
Processes an ActiveJob job from an SQS message.
Methods included from Worker
Instance Method Details
#perform(sqs_msg, hash) ⇒ Object
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.
Processes an ActiveJob job from an SQS message.
21 22 23 24 25 |
# File 'lib/shoryuken/active_job/job_wrapper.rb', line 21 def perform(sqs_msg, hash) receive_count = sqs_msg.attributes['ApproximateReceiveCount'].to_i past_receives = receive_count - 1 ::ActiveJob::Base.execute hash.merge({ 'executions' => past_receives }) end |