Class: Cosmo::Batch::Callback
- Inherits:
-
Object
- Object
- Cosmo::Batch::Callback
- Includes:
- Job
- Defined in:
- lib/cosmo/batch/callback.rb,
sig/cosmo/batch/callback.rbs
Overview
The actual job that gets enqueued when a batch finishes. It looks up the plain Ruby class you passed to Batch#on and calls on_success or on_complete on it.
Instance Attribute Summary
Attributes included from Job
#attempt, #batch_id, #enqueued_at, #jid, #scheduled_by
Instance Method Summary collapse
Methods included from Job
Instance Method Details
#perform(class_name, event, status, opts) ⇒ void
This method returns an undefined value.
11 12 13 14 |
# File 'lib/cosmo/batch/callback.rb', line 11 def perform(class_name, event, status, opts) klass = Utils::String.safe_constantize(class_name) klass&.new&.public_send("on_#{event}", status, opts) end |