Class: Cosmo::ActiveJobAdapter::Executor
- Inherits:
-
Object
- Object
- Cosmo::ActiveJobAdapter::Executor
- Includes:
- Job
- Defined in:
- lib/cosmo/active_job/executor.rb,
sig/cosmo/active_job/executor.rbs
Overview
Cosmo::Job that deserializes and executes an ActiveJob payload
Instance Attribute Summary
Attributes included from Job
#attempt, #batch_id, #enqueued_at, #jid, #scheduled_by
Class Method Summary collapse
-
.retry_in(data) ⇒ Proc?
Resolves
retry_infrom the underlying ActiveJob class (declared viacosmo_options), since the processor only ever seesExecutoras the worker class for ActiveJob-dispatched jobs.
Instance Method Summary collapse
Methods included from Job
Class Method Details
.retry_in(data) ⇒ Proc?
Resolves retry_in from the underlying ActiveJob class (declared via cosmo_options),
since the processor only ever sees Executor as the worker class for ActiveJob-dispatched jobs.
13 14 15 16 17 18 |
# File 'lib/cosmo/active_job/executor.rb', line 13 def self.retry_in(data) job_class = Utils::String.safe_constantize(data.dig(:args, 0, :job_class)) return super unless job_class.respond_to?(:get_cosmo_options) job_class.[:retry_in] || super end |
Instance Method Details
#perform(job_data) ⇒ void
This method returns an undefined value.
20 21 22 |
# File 'lib/cosmo/active_job/executor.rb', line 20 def perform(job_data) ::ActiveJob::Base.execute(Utils::Hash.stringify_keys(job_data)) end |