Module: CDC::Sidekiq::ProcessorJob
- Defined in:
- lib/cdc/sidekiq/processor_job.rb
Overview
Sidekiq job mixin that executes work through CDC runtime primitives.
The job remains a normal Sidekiq job. Sidekiq still owns scheduling, retries, queues, and persistence. cdc-sidekiq only changes how the job executes its payload once Sidekiq has started the job.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ void
Add CDC processor-job class methods to the including job class.
Instance Method Summary collapse
-
#perform(payload) ⇒ Object+
Execute a Sidekiq payload through the configured CDC runtime.
Class Method Details
.included(base) ⇒ void
This method returns an undefined value.
Add CDC processor-job class methods to the including job class.
34 35 36 |
# File 'lib/cdc/sidekiq/processor_job.rb', line 34 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#perform(payload) ⇒ Object+
Execute a Sidekiq payload through the configured CDC runtime.
Array payloads are processed with #process_many when cdc_batch_payloads is enabled. Other payloads are processed with #process.
47 48 49 50 51 |
# File 'lib/cdc/sidekiq/processor_job.rb', line 47 def perform(payload) results = process_payload(payload) handle_processor_failures(results) results end |