Class: Servus::Extensions::Async::Job Private
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- Servus::Extensions::Async::Job
- Defined in:
- lib/servus/extensions/async/job.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.
Abstract ActiveJob base class for executing Servus services asynchronously.
This class is never enqueued directly. Instead, Call generates a named
subclass per service (e.g. Treasury::TransferGold::ServiceJob) so that
background runners like Sidekiq and GoodJob display a meaningful, per-service
job name rather than one generic class for every invocation.
Each generated subclass carries a reference to its owning service in #servus_service, set at generation time. #perform uses that reference to route back through the standard Base.call lifecycle — validation, logging, benchmarking, guards, and event emission all run exactly as if the service had been called synchronously.
Instance Method Summary collapse
-
#perform(**args) ⇒ Servus::Support::Response
private
Executes the job's service with the provided arguments.
-
#servus_service ⇒ Class<Servus::Base>?
private
The service class this job invokes.
Instance Method Details
#perform(**args) ⇒ Servus::Support::Response
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.
Executes the job's service with the provided arguments.
The service is identified by #servus_service rather than a serialized name — the job class itself encodes which service to run.
44 45 46 |
# File 'lib/servus/extensions/async/job.rb', line 44 def perform(**args) self.class.servus_service.call(**args) end |
#servus_service ⇒ Class<Servus::Base>?
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.
The service class this job invokes. Set on each generated subclass when Call#build_servus_job_class creates it.
31 |
# File 'lib/servus/extensions/async/job.rb', line 31 class_attribute :servus_service |